From: Chris Tallon Date: Wed, 1 Feb 2017 16:55:56 +0000 (+0000) Subject: Fix hang skipping after pause (thread deadlock / videoomx thread cancellation protection) X-Git-Tag: 0-5-0~16 X-Git-Url: https://git.vomp.tv/gitweb/?a=commitdiff_plain;h=34fbabc2fdf50445a737ede429704d49b5341b12;p=vompclient.git Fix hang skipping after pause (thread deadlock / videoomx thread cancellation protection) --- diff --git a/videoomx.cc b/videoomx.cc index bb16ffe..b96b830 100644 --- a/videoomx.cc +++ b/videoomx.cc @@ -2819,10 +2819,19 @@ bool VideoOMX::DrainTargetBufferFull() if (full && omx_vid_stalled && !omx_first_frame) { omx_vid_stalled=false; Log::getInstance()->log("Video", Log::DEBUG, "Decoder is stalled, do a reset!"); + + int oldcancelstate; + int oldcanceltype; + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldcancelstate); + pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldcanceltype); + clock_mutex.Lock(); FlushRenderingPipe(); omx_first_frame=true; clock_mutex.Unlock(); + + pthread_setcancelstate(oldcancelstate, NULL); + pthread_setcanceltype(oldcanceltype, NULL); } return full;