From 31f2c7d4477a7824567fc0ea70f1d7c24c9a041b Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 12 Apr 2016 14:49:50 +0200 Subject: Remote mpeg2 decoding at the start of a GOP, in addition to after a keyframe This allows playing intra-refresh mpeg2 samples, and should hopefully limit the amount of distortion it may allow to be shown after a seek to open-gop streams. --- decoder/LAVVideo/decoders/avcodec.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'decoder') diff --git a/decoder/LAVVideo/decoders/avcodec.cpp b/decoder/LAVVideo/decoders/avcodec.cpp index 5b5c44de..73e3a323 100644 --- a/decoder/LAVVideo/decoders/avcodec.cpp +++ b/decoder/LAVVideo/decoders/avcodec.cpp @@ -778,6 +778,9 @@ STDMETHODIMP CDecAvcodec::Decode(const BYTE *buffer, int buflen, REFERENCE_TIME if (state & STATE_EOS_FOUND) { bEndOfSequence = TRUE; } + if (state & STATE_GOP_FOUND && m_nCodecId == AV_CODEC_ID_MPEG2VIDEO) { + m_bWaitingForKeyFrame = FALSE; + } } else { avpkt.data = nullptr; avpkt.size = 0; -- cgit v1.2.3