Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/LAVFilters.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-12-09 01:35:55 +0300
committerHendrik Leppkes <h.leppkes@gmail.com>2016-12-09 01:35:55 +0300
commit6a03ce4a405e7fad4231201433df12099ff90bb4 (patch)
treef1543e12b2639f9895981719effae3b6a41d6bd5 /decoder
parent51eca509ef71adaa3ca938f41fa4f6198432cae9 (diff)
avcodec: use strict h264 handling on file-based playback with LAV Splitter
Keep using the old logic for streaming playback or any other source filters where we don't know where the data coming from.
Diffstat (limited to 'decoder')
-rw-r--r--decoder/LAVVideo/LAVVideo.cpp2
-rw-r--r--decoder/LAVVideo/decoders/ILAVDecoder.h1
-rw-r--r--decoder/LAVVideo/decoders/avcodec.cpp8
3 files changed, 9 insertions, 2 deletions
diff --git a/decoder/LAVVideo/LAVVideo.cpp b/decoder/LAVVideo/LAVVideo.cpp
index ba9db960..eaff6752 100644
--- a/decoder/LAVVideo/LAVVideo.cpp
+++ b/decoder/LAVVideo/LAVVideo.cpp
@@ -697,6 +697,8 @@ HRESULT CLAVVideo::CreateDecoder(const CMediaType *pmt)
m_dwDecodeFlags |= LAV_VIDEO_DEC_FLAG_NO_MT;
if (bSageVC1Hack)
m_dwDecodeFlags |= LAV_VIDEO_DEC_FLAG_SAGE_HACK;
+ if (m_LAVPinInfoValid && (m_LAVPinInfo.flags & LAV_STREAM_FLAG_LIVE))
+ m_dwDecodeFlags |= LAV_VIDEO_DEC_FLAG_LIVE;
SAFE_CO_FREE(pszExtension);
diff --git a/decoder/LAVVideo/decoders/ILAVDecoder.h b/decoder/LAVVideo/decoders/ILAVDecoder.h
index 53acbeaf..540c3705 100644
--- a/decoder/LAVVideo/decoders/ILAVDecoder.h
+++ b/decoder/LAVVideo/decoders/ILAVDecoder.h
@@ -237,6 +237,7 @@ interface ILAVVideoCallback
#define LAV_VIDEO_DEC_FLAG_DVD 0x00000010
#define LAV_VIDEO_DEC_FLAG_NO_MT 0x00000020
#define LAV_VIDEO_DEC_FLAG_SAGE_HACK 0x00000040
+#define LAV_VIDEO_DEC_FLAG_LIVE 0x00000080
/**
* Get the input media type
diff --git a/decoder/LAVVideo/decoders/avcodec.cpp b/decoder/LAVVideo/decoders/avcodec.cpp
index 4fcf3696..8acdf4a1 100644
--- a/decoder/LAVVideo/decoders/avcodec.cpp
+++ b/decoder/LAVVideo/decoders/avcodec.cpp
@@ -518,8 +518,12 @@ STDMETHODIMP CDecAvcodec::InitDecoder(AVCodecID codec, const CMediaType *pmt)
}
if (bLAVInfoValid) {
- // Setting has_b_frames to a proper value will ensure smoother decoding of H264
- if (lavPinInfo.has_b_frames >= 0) {
+ // Use strict decoding with LAV Splitter and non-live sources
+ if (codec == AV_CODEC_ID_H264 && !(dwDecFlags & LAV_VIDEO_DEC_FLAG_LIVE) && m_bFFReordering) {
+ m_pAVCtx->strict_std_compliance = FF_COMPLIANCE_STRICT;
+ }
+ // Try to set the has_b_frames info if available
+ else if (lavPinInfo.has_b_frames >= 0) {
DbgLog((LOG_TRACE, 10, L"-> Setting has_b_frames to %d", lavPinInfo.has_b_frames));
m_pAVCtx->has_b_frames = lavPinInfo.has_b_frames;