diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2017-08-04 20:38:38 +0300 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2017-08-04 20:38:38 +0300 |
commit | 154fd871b4483171ce8bda9ef0e9746e21d27829 (patch) | |
tree | e174f5b0cc3426a4b07701c69d0c59f8beba3020 /decoder/LAVVideo | |
parent | ecd67f27ef002bab9d90afb7e2fbb7f8d7d63698 (diff) |
Persist the x264 build between decoder re-inits
Diffstat (limited to 'decoder/LAVVideo')
-rw-r--r-- | decoder/LAVVideo/decoders/avcodec.cpp | 10 | ||||
-rw-r--r-- | decoder/LAVVideo/decoders/avcodec.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/decoder/LAVVideo/decoders/avcodec.cpp b/decoder/LAVVideo/decoders/avcodec.cpp index 06809972..eaf02c32 100644 --- a/decoder/LAVVideo/decoders/avcodec.cpp +++ b/decoder/LAVVideo/decoders/avcodec.cpp @@ -573,6 +573,10 @@ STDMETHODIMP CDecAvcodec::InitDecoder(AVCodecID codec, const CMediaType *pmt) return VFW_E_UNSUPPORTED_VIDEO; } + if (codec == AV_CODEC_ID_H264 && m_nx264build != -1) { + av_opt_set_int(m_pAVCtx->priv_data, "x264_build", m_nx264build, 0); + } + m_iInterlaced = 0; for (int i = 0; i < countof(ff_interlace_capable); i++) { if (codec == ff_interlace_capable[i]) { @@ -631,6 +635,12 @@ STDMETHODIMP CDecAvcodec::DestroyDecoder() } if (m_pAVCtx) { + if (m_pAVCtx->codec_id == AV_CODEC_ID_H264) { + int64_t x264build = -1; + if (av_opt_get_int(m_pAVCtx->priv_data, "x264_build", 0, &x264build) >= 0) + m_nx264build = x264build; + } + avcodec_close(m_pAVCtx); av_freep(&m_pAVCtx->hwaccel_context); av_freep(&m_pAVCtx->extradata); diff --git a/decoder/LAVVideo/decoders/avcodec.h b/decoder/LAVVideo/decoders/avcodec.h index 7a3d50a7..63b22404 100644 --- a/decoder/LAVVideo/decoders/avcodec.h +++ b/decoder/LAVVideo/decoders/avcodec.h @@ -98,4 +98,6 @@ private: BOOL m_bWaitingForKeyFrame = FALSE; int m_iInterlaced = -1; int m_nSoftTelecine = 0; + + int m_nx264build = -1; }; |