From b0df7aa1d848adeb2417f55daced7e673d5022fa Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Tue, 26 Sep 2017 17:08:39 +0100 Subject: [PATCH] Fix RPi pause black screen bug --- player.cc | 9 +++++++++ vfeed.cc | 5 +++-- vfeed.h | 3 ++- vtimeredit.cc | 0 4 files changed, 14 insertions(+), 3 deletions(-) mode change 100755 => 100644 vtimeredit.cc diff --git a/player.cc b/player.cc index e1cc01b..491650b 100644 --- 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; } diff --git a/vfeed.cc b/vfeed.cc index 1f0af70..c3823a5 100644 --- 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 0fa2721..9ca213a 100644 --- 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 diff --git a/vtimeredit.cc b/vtimeredit.cc old mode 100755 new mode 100644 -- 2.39.2