[libav-devel] [PATCH 7/7] avcodec/decode: copy the output parameters from the last bsf in the chain back to the AVCodecContext

James Almer jamrial at gmail.com
Fri Jul 27 19:59:57 CEST 2018


Certain AVCodecParameters, like the contents of the extradata, may be changed
by the init() function of any of the bitstream filters in the chain.

Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavcodec/decode.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 2dab7f2a7..d10a2c8b5 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -221,6 +221,10 @@ int ff_decode_bsfs_init(AVCodecContext *avctx)
             goto fail;
     }
 
+    ret = avcodec_parameters_to_context(avctx, s->bsfs[s->nb_bsfs - 1]->par_out);
+    if (ret < 0)
+        return ret;
+
     return 0;
 fail:
     ff_decode_bsfs_uninit(avctx);
-- 
2.18.0



More information about the libav-devel mailing list