From 52eed616fc531c4a767c111c2020cb4512769d74 Mon Sep 17 00:00:00 2001 From: Marten Richter Date: Tue, 7 Oct 2014 07:51:40 +0200 Subject: [PATCH] Fix locking and thread cancelation state in updatemode --- videoomx.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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); -- 2.39.2