diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2016-12-08 13:30:05 +0300 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2016-12-08 13:30:05 +0300 |
commit | f5ff9957e5c32a91d2c21e6fec89abc0d5fcaea3 (patch) | |
tree | 7fb0955f14c601b8b6656e6aace06ac1f5d46858 /decoder | |
parent | b5a4eb7cfeeab6869a6cfdeec0cad0dfc9c6e717 (diff) |
Set the guessed number of H264 out-of-order frames to at least 2
This avoids dropping frames in the most common broadcast streams while
still keeping decode latency low.
Fixes GitHub issue #113
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/LAVVideo/decoders/avcodec.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/decoder/LAVVideo/decoders/avcodec.cpp b/decoder/LAVVideo/decoders/avcodec.cpp index 84c4769c..4fcf3696 100644 --- a/decoder/LAVVideo/decoders/avcodec.cpp +++ b/decoder/LAVVideo/decoders/avcodec.cpp @@ -522,6 +522,10 @@ STDMETHODIMP CDecAvcodec::InitDecoder(AVCodecID codec, const CMediaType *pmt) 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; + + // Set H264 to at least 2 B-Frames, which is the most common for broadcasts + if (codec == AV_CODEC_ID_H264 && m_pAVCtx->has_b_frames == 1) + m_pAVCtx->has_b_frames = 2; } } |