diff options
author | huceke <ebsi4711@gmail.com> | 2013-02-11 12:10:10 -0800 |
---|---|---|
committer | huceke <ebsi4711@gmail.com> | 2013-02-11 12:10:10 -0800 |
commit | 7901a6047501071611971d4ca047ae078c55f4f9 (patch) | |
tree | d546c6271d493fa5fba8e55914839baa675b1077 | |
parent | 728e9c1fee2bc91de0b130d2773e0ec18098570c (diff) | |
parent | 94ea56fc7c14ade6338e00ff67942ebd7b345e01 (diff) |
Merge pull request #2206 from popcornmix/fix_video_fifo_ass
[rbp] Fix for broken ASS subtitles.
-rw-r--r-- | xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 19 | ||||
-rw-r--r-- | xbmc/cores/omxplayer/OMXPlayerVideo.h | 1 |
2 files changed, 16 insertions, 4 deletions
diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp index 4dec28af8f..ec7e7f61cf 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -124,6 +124,7 @@ bool OMXPlayerVideo::OpenStream(CDVDStreamInfo &hints) m_started = false; m_stalled = m_messageQueue.GetPacketCount(CDVDMsg::DEMUXER_PACKET) == 0; m_autosync = 1; + m_iSleepEndTime = DVD_NOPTS_VALUE; m_audio_count = m_av_clock->HasAudio(); @@ -452,13 +453,23 @@ void OMXPlayerVideo::Output(int iGroupId, double pts, bool bDropPacket) m_dropbase = 0.0f; #endif - double pts_media = m_av_clock->OMXMediaTime(false, false); - ProcessOverlays(iGroupId, pts_media); + // DVDPlayer sleeps until m_iSleepEndTime here before calling FlipPage. + // Video playback in asynchronous in OMXPlayer, so we don't want to do that here, as it prevents the video fifo from being kept full. + // So, we keep track of when FlipPage would have been called on DVDPlayer and return early if it is not time. + // m_iSleepEndTime == DVD_NOPTS_VALUE means we are not waiting to call FlipPage, otherwise it is the time we want to call FlipPage + if (m_iSleepEndTime == DVD_NOPTS_VALUE) { + m_iSleepEndTime = iCurrentClock + iSleepTime; + } - if (!CThread::m_bStop && m_av_clock->GetAbsoluteClock(false) < (iCurrentClock + iSleepTime + DVD_MSEC_TO_TIME(500)) ) + if (!CThread::m_bStop && m_av_clock->GetAbsoluteClock(false) < m_iSleepEndTime) return; - g_renderManager.FlipPage(CThread::m_bStop, (iCurrentClock + iSleepTime) / DVD_TIME_BASE, -1, FS_NONE); + m_iSleepEndTime = DVD_NOPTS_VALUE; + + double pts_media = m_av_clock->OMXMediaTime(false, false); + ProcessOverlays(iGroupId, pts_media); + + g_renderManager.FlipPage(CThread::m_bStop, pts_media / DVD_TIME_BASE, -1, FS_NONE); //m_av_clock->WaitAbsoluteClock((iCurrentClock + iSleepTime)); } diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.h b/xbmc/cores/omxplayer/OMXPlayerVideo.h index 3fd643e54e..cf05c1f3f6 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.h +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.h @@ -49,6 +49,7 @@ protected: bool m_open; CDVDStreamInfo m_hints; double m_iCurrentPts; + double m_iSleepEndTime; OMXClock *m_av_clock; COMXVideo m_omxVideo; float m_fFrameRate; |