Fix RPi pause black screen bug
authorChris Tallon <chris@vomp.tv>
Tue, 26 Sep 2017 16:08:39 +0000 (17:08 +0100)
committerChris Tallon <chris@vomp.tv>
Tue, 26 Sep 2017 16:08:39 +0000 (17:08 +0100)
player.cc
vfeed.cc
vfeed.h
vtimeredit.cc [changed mode: 0755->0644]

index e1cc01bedb547b05dd955f9f7ccfc3ecc5c22295..491650b1349cfddf9eed0e7edfaf356319838588 100644 (file)
--- a/player.cc
+++ b/player.cc
@@ -478,6 +478,10 @@ void Player::switchState(UCHAR toState, ULONG jumpFrame)
         }
         case S_PAUSE_P: // to S_PAUSE_P
         {
+          #ifdef VOMP_PLATTFORM_RASPBERRY
+          vfeed.stop(); // can't vfeed during pause
+          #endif
+
           video->pause();
           audio->pause();
           state = S_PAUSE_P;
@@ -562,6 +566,11 @@ void Player::switchState(UCHAR toState, ULONG jumpFrame)
         {
           video->unPause();
           audio->unPause();
+
+          #ifdef VOMP_PLATTFORM_RASPBERRY
+          vfeed.start(false);
+          #endif
+
           state = S_PLAY;
           return;
         }
index 1f0af70638f557d614f54791f632cde4d4919908..c3823a58363a482c4fa1b587eba4e66b6a3a0279 100644 (file)
--- a/vfeed.cc
+++ b/vfeed.cc
@@ -40,8 +40,9 @@ int VFeed::shutdown()
   return 1;
 }
 
-int VFeed::start()
+int VFeed::start(bool tWaitForSignal)
 {
+  waitForSignal = tWaitForSignal;
   return threadStart();
 }
 
@@ -62,7 +63,7 @@ void VFeed::threadMethod()
   bool vlen;
 
   Log::getInstance()->log("VFeed", Log::DEBUG, "Started");
-  threadWaitForSignal(); // Don't feed video until audio has started
+  if (waitForSignal) threadWaitForSignal(); // Don't feed video until audio has started
   Log::getInstance()->log("VFeed", Log::DEBUG, "Released");
 
   while(1)
diff --git a/vfeed.h b/vfeed.h
index 0fa27211b3b62818f30ed136346a5507eb5a0c43..9ca213af9c2babdc7a0931499bb265843d7d5d94 100644 (file)
--- a/vfeed.h
+++ b/vfeed.h
@@ -44,7 +44,7 @@ class VFeed : public Thread_TYPE
 
     int shutdown();
 
-    int start();
+    int start(bool tWaitForSignal = true);
     void stop();
     void release();
 
@@ -52,6 +52,7 @@ class VFeed : public Thread_TYPE
     void threadMethod();
     void threadPostStopCleanup() {};
     Callback& cb;
+    bool waitForSignal;
 };
 
 #endif
old mode 100755 (executable)
new mode 100644 (file)