Permalink
Browse files

VideoPlayer: drain decoder on stream change

  • Loading branch information...
FernetMenta authored and popcornmix committed Jan 13, 2016
1 parent ea2ccbb commit e84dcea5a025f682ed1f5c2a93241d24483e7355
Showing with 16 additions and 1 deletion.
  1. +16 −1 xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp
@@ -370,13 +370,28 @@ void CVideoPlayerVideo::Process()
else if (pMsg->IsType(CDVDMsg::GENERAL_STREAMCHANGE))
{
CDVDMsgVideoCodecChange* msg(static_cast<CDVDMsgVideoCodecChange*>(pMsg));
while (!m_bStop && m_pVideoCodec)
{
m_pVideoCodec->SetCodecControl(DVD_CODEC_CTRL_DRAIN);
int decoderState = m_pVideoCodec->Decode(NULL, 0, DVD_NOPTS_VALUE, DVD_NOPTS_VALUE);
bool cont = ProcessDecoderOutput(decoderState, frametime, pts);
if (!cont)
break;
if (decoderState & VC_BUFFER)
break;
}
OpenStream(msg->m_hints, msg->m_codec);
msg->m_codec = NULL;
m_picture.iFlags &= ~DVP_FLAG_ALLOCATED;
}
else if (pMsg->IsType(CDVDMsg::VIDEO_DRAIN))
{
while (!m_bStop)
while (!m_bStop && m_pVideoCodec)
{
m_pVideoCodec->SetCodecControl(DVD_CODEC_CTRL_DRAIN);
int decoderState = m_pVideoCodec->Decode(NULL, 0, DVD_NOPTS_VALUE, DVD_NOPTS_VALUE);

0 comments on commit e84dcea

Please sign in to comment.