History

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.

Andreas Rheinhardt committed 1 year ago

Commit 9102a901 parent 730ffc51 file · +0 −3Browse files

Unified · Split

libavcodec/decode.c+0−3
@@ -202,9 +202,6 @@ static int decode_bsfs_init(AVCodecContext *avctx) · 201 unmodified lines
202 goto fail;202 goto fail;
203 203
204 ret = av_bsf_init(avci->bsf);204 ret = av_bsf_init(avci->bsf);
205 if (ret < 0)
206 goto fail;
207 ret = avcodec_parameters_to_context(avctx, avci->bsf->par_out);
208 if (ret < 0)205 if (ret < 0)
209 goto fail;206 goto fail;
210 207

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t