diff options
author | Rainer Hochecker <fernetmenta@online.de> | 2015-04-24 13:42:25 +0200 |
---|---|---|
committer | Rainer Hochecker <fernetmenta@online.de> | 2015-04-24 14:37:00 +0200 |
commit | c500e18ad44846450deca71f94d3e677e6d33dd7 (patch) | |
tree | 279070ab74832fe6894d77488f1d5d74d9056018 | |
parent | 35c7f24ded3de0a6d56c3683d883932c07b346d1 (diff) |
dvdplayer: add missing msg handler for GENERAL_SYNCHRONIZE
-rw-r--r-- | xbmc/cores/dvdplayer/DVDMessage.cpp | 15 | ||||
-rw-r--r-- | xbmc/cores/dvdplayer/DVDPlayer.cpp | 5 | ||||
-rw-r--r-- | xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 4 |
3 files changed, 16 insertions, 8 deletions
diff --git a/xbmc/cores/dvdplayer/DVDMessage.cpp b/xbmc/cores/dvdplayer/DVDMessage.cpp index b027fa928d..ae745c6a50 100644 --- a/xbmc/cores/dvdplayer/DVDMessage.cpp +++ b/xbmc/cores/dvdplayer/DVDMessage.cpp @@ -25,6 +25,7 @@ #include "threads/CriticalSection.h" #include "threads/Condition.h" #include "utils/MathUtils.h" +#include "utils/log.h" class CDVDMsgGeneralSynchronizePriv { @@ -56,7 +57,7 @@ CDVDMsgGeneralSynchronize::~CDVDMsgGeneralSynchronize() bool CDVDMsgGeneralSynchronize::Wait(unsigned int milliseconds, unsigned int source) { - if(source == 0) + if (source == 0) source = SYNCSOURCE_OWNER; /* if we are not requested to wait on this object just return, reference count will be decremented */ @@ -69,15 +70,21 @@ bool CDVDMsgGeneralSynchronize::Wait(unsigned int milliseconds, unsigned int sou m_p->reached |= source & m_p->sources; - while( (long)MathUtils::bitcount(m_p->reached) < GetNrOfReferences() ) + while ((long)MathUtils::bitcount(m_p->reached) < GetNrOfReferences()) { milliseconds = std::min(m_p->timeout.MillisLeft(), timeout.MillisLeft()); if(m_p->condition.wait(lock, milliseconds)) continue; - if(m_p->timeout.IsTimePast()) + if (m_p->timeout.IsTimePast()) + { + CLog::Log(LOGDEBUG, "CDVDMsgGeneralSynchronize - global timeout"); return true; /* global timeout, we are done */ - if(timeout.IsTimePast()) + } + if (timeout.IsTimePast()) + { + CLog::Log(LOGERROR, "CDVDMsgGeneralSynchronize - timeout"); return false; /* request timeout, should be retried */ + } } return true; } diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp index 4c616a432a..37865b5d18 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -2666,6 +2666,11 @@ void CDVDPlayer::HandleMessages() SetSubtitleVisibleInternal(true); } } + else if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE)) + { + if (((CDVDMsgGeneralSynchronize*)pMsg)->Wait(100, SYNCSOURCE_OWNER)) + CLog::Log(LOGDEBUG, "CDVDPlayer - CDVDMsg::GENERAL_SYNCHRONIZE"); + } pMsg->Release(); } diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp index d59384d179..6b24b254d9 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -368,10 +368,6 @@ void CDVDPlayerVideo::Process() } else m_messageQueue.Put(pMsg->Acquire(), 1); /* push back as prio message, to process other prio messages */ - - pMsg->Release(); - - continue; } else if (pMsg->IsType(CDVDMsg::GENERAL_RESYNC)) { |