]> git.vomp.tv Git - vompclient.git/commitdiff
Fix locking and thread cancelation state in updatemode
authorMarten Richter <marten.richter@freenet.de>
Tue, 7 Oct 2014 05:51:40 +0000 (07:51 +0200)
committerMarten Richter <marten.richter@freenet.de>
Tue, 7 Oct 2014 05:51:40 +0000 (07:51 +0200)
videoomx.cc

index a1017d96e1dbe21ebbf9fcd03dfa111b31301bc6..efaa9da95635b90d1fc93b9f2b21e99b1355c4de 100644 (file)
@@ -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);