From: Marten Richter Date: Tue, 7 Oct 2014 05:51:40 +0000 (+0200) Subject: Fix locking and thread cancelation state in updatemode X-Git-Tag: 0-5-0~58 X-Git-Url: https://git.vomp.tv/gitweb/?a=commitdiff_plain;h=52eed616fc531c4a767c111c2020cb4512769d74;p=vompclient.git Fix locking and thread cancelation state in updatemode --- diff --git a/videoomx.cc b/videoomx.cc index a1017d9..efaa9da 100644 --- a/videoomx.cc +++ b/videoomx.cc @@ -604,6 +604,8 @@ void VideoOMX::updateMode() if (error != OMX_ErrorNone) { Log::getInstance()->log("Video", Log::DEBUG, "Set OMX_IndexConfigDisplayRegion1 failed %x", error); + pthread_setcancelstate(oldcancelstate, NULL); + pthread_setcanceltype(oldcanceltype, NULL); clock_mutex.Unlock(); return; } @@ -617,6 +619,8 @@ void VideoOMX::updateMode() if (error != OMX_ErrorNone) { Log::getInstance()->log("Video", Log::DEBUG, "Set OMX_IndexConfigDisplayRegion5 failed %x", error); + pthread_setcancelstate(oldcancelstate, NULL); + pthread_setcanceltype(oldcanceltype, NULL); clock_mutex.Unlock(); return; } @@ -635,6 +639,8 @@ void VideoOMX::updateMode() if (error != OMX_ErrorNone) { Log::getInstance()->log("Video", Log::DEBUG, "Set OMX_IndexConfigDisplayRegion2 failed %x", error); + pthread_setcancelstate(oldcancelstate, NULL); + pthread_setcanceltype(oldcanceltype, NULL); clock_mutex.Unlock(); return; } @@ -651,6 +657,8 @@ void VideoOMX::updateMode() if (error != OMX_ErrorNone) { Log::getInstance()->log("Video", Log::DEBUG, "Set OMX_IndexConfigDisplayRegion3 failed %x", error); + pthread_setcancelstate(oldcancelstate, NULL); + pthread_setcanceltype(oldcanceltype, NULL); clock_mutex.Unlock(); return; } @@ -662,6 +670,8 @@ void VideoOMX::updateMode() < 0) { Log::getInstance()->log("OSD", Log::WARN, "Getting display size failed! (BCM API) "); + pthread_setcancelstate(oldcancelstate, NULL); + pthread_setcanceltype(oldcanceltype, NULL); clock_mutex.Unlock(); return; } @@ -682,11 +692,12 @@ void VideoOMX::updateMode() if (error != OMX_ErrorNone) { Log::getInstance()->log("Video", Log::DEBUG, "Set OMX_IndexConfigDisplayRegion failed %x", error); + pthread_setcancelstate(oldcancelstate, NULL); + pthread_setcanceltype(oldcanceltype, NULL); clock_mutex.Unlock(); return; } } - clock_mutex.Unlock(); pthread_setcancelstate(oldcancelstate, NULL); pthread_setcanceltype(oldcanceltype, NULL);