[FFmpeg-cvslog] Revert "avcodec/decode: Fix avcodec parameters when bsfs are enable by decoder"
Andreas Rheinhardt
git at videolan.org
Tue Jun 17 01:59:10 EEST 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Wed Jun 11 14:52:47 2025 +0200| [9102a90a95d9b65f482c281d886d94ef74ff0bd3] | committer: Andreas Rheinhardt
Revert "avcodec/decode: Fix avcodec parameters when bsfs are enable by decoder"
This reverts commit 1c170613975d3cbcbb5aaa469b4a3cf0df5d4c2b.
The commit intended to provide certain codecs using *_mp4toannexb
bitstream filters with updated (annex B) extradata (even when
the user-supplied one was ISOBMFF), yet BSFs are allowed to change
way more. The media100_to_mjpegb BSF used by the media100 decoder
changes the codec id; the commit being reverted therefore changed
AVCodecContext.codec_id which is an API violation and broke
media100 decoding with the FFmpeg cli tool.
This commit also made changes from the internal BSF externally
visible. extradata is documented to be "owned by the codec and
freed in avcodec_free_context()" which does not include replacing
it with something else in avcodec_open2() and may surprise users
who think that AVCodecContext.extradata is immutable before
avcodec_free_context(). It also incurred a memdup which is completely
unnecessary for most decoders.
Therefore this commit is reverted. The problem it tried to solve
will be solved differently in the next commit.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9102a90a95d9b65f482c281d886d94ef74ff0bd3
---
libavcodec/decode.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index ef09568381..2319e76e4b 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -202,9 +202,6 @@ static int decode_bsfs_init(AVCodecContext *avctx)
goto fail;
ret = av_bsf_init(avci->bsf);
- if (ret < 0)
- goto fail;
- ret = avcodec_parameters_to_context(avctx, avci->bsf->par_out);
if (ret < 0)
goto fail;
More information about the ffmpeg-cvslog
mailing list