Skip to content

Commit

Permalink
VideoPlayer: fix drain for ffmpeg when filters are involved
Browse files Browse the repository at this point in the history
  • Loading branch information
FernetMenta committed Jan 15, 2016
1 parent 7e36f37 commit 3647b2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -607,11 +607,14 @@ int CDVDVideoCodecFFmpeg::Decode(uint8_t* pData, int iSize, double dts, double p
int result;
if (m_pHardware)
result = m_pHardware->Decode(m_pCodecContext, m_pFrame);
else if (m_pFilterGraph && !(m_codecControlFlags & DVD_CODEC_CTRL_DRAIN))
else if (m_pFilterGraph)
result = FilterProcess(m_pFrame);
else
result = VC_PICTURE | VC_BUFFER;

if (m_codecControlFlags & DVD_CODEC_CTRL_DRAIN)
result &= ~VC_BUFFER;

if (result & VC_FLUSHED)
Reset();

Expand Down
2 changes: 2 additions & 0 deletions xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ bool CVideoPlayerVideo::OpenStream( CDVDStreamInfo &hint )

void CVideoPlayerVideo::OpenStream(CDVDStreamInfo &hint, CDVDVideoCodec* codec)
{
CLog::Log(LOGDEBUG, "CVideoPlayerVideo::OpenStream - open stream with codec id: %i", hint.codec);

//reported fps is usually not completely correct
if (hint.fpsrate && hint.fpsscale)
m_fFrameRate = DVD_TIME_BASE / CDVDCodecUtils::NormalizeFrameduration((double)DVD_TIME_BASE * hint.fpsscale / hint.fpsrate);
Expand Down

0 comments on commit 3647b2f

Please sign in to comment.