mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
avformat/demux: ensure ch_layout is not lost in the stream's internal avctx
This is a workaround until avcodec_close() stops freeing ch_layout through
av_opt_fre(), or the former is removed.
Fixes a regression since 327efa6633
.
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
505a7d39cd
commit
37f4440682
@ -2957,6 +2957,9 @@ find_stream_info_err:
|
||||
av_freep(&sti->info);
|
||||
}
|
||||
avcodec_close(sti->avctx);
|
||||
// FIXME: avcodec_close() frees AVOption settable fields which includes ch_layout,
|
||||
// so we need to restore it.
|
||||
av_channel_layout_copy(&sti->avctx->ch_layout, &st->codecpar->ch_layout);
|
||||
av_bsf_free(&sti->extract_extradata.bsf);
|
||||
}
|
||||
if (ic->pb) {
|
||||
|
Loading…
Reference in New Issue
Block a user