From d758cdb02043a07a4e9d65c1fbbce736c6932efe Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 20 Sep 2016 12:07:53 +0200 Subject: VideoPlayer: handle exceptional case where distance between keyframes is greater than demux queue --- xbmc/cores/VideoPlayer/VideoPlayer.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp index f1d836fecc..cd64ac7059 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp @@ -2060,6 +2060,18 @@ void CVideoPlayer::HandlePlaySpeed() m_syncTimer.Set(3000); } + else + { + // exceptions for which stream players won't start properly + // 1. videoplayer has not detected a keyframe within lenght of demux buffers + if (m_CurrentAudio.id >= 0 && m_CurrentVideo.id >= 0 && + !m_VideoPlayerAudio->AcceptsData() && + m_VideoPlayerVideo->IsStalled()) + { + CLog::Log(LOGWARNING, "VideoPlayer::Sync - stream player video does not start, flushing buffers"); + FlushBuffers(false); + } + } } // handle ff/rw -- cgit v1.2.3