aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-04-02 20:21:13 -0300
committerJames Almer <jamrial@gmail.com>2024-04-02 20:21:13 -0300
commit50458b7fa1fc9b22ae48d410954585780f1a44f7 (patch)
tree1a90188d0608adcc37b9cb3794e195c54c84c100
parentd157725cf726adc29385d264eaf79ae430b1f3e5 (diff)
downloadffmpeg-50458b7fa1fc9b22ae48d410954585780f1a44f7.tar.gz
avformat/isom: don't drop the known layout when parsing AAC decSpecificInfo
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavformat/isom.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/isom.c b/libavformat/isom.c
index c5930bd4d8..74bb13dc96 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -359,9 +359,11 @@ int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext
st->codecpar->extradata_size, 1, fc);
if (ret < 0)
return ret;
- av_channel_layout_uninit(&st->codecpar->ch_layout);
- st->codecpar->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
- st->codecpar->ch_layout.nb_channels = cfg.channels;
+ if (cfg.channels != st->codecpar->ch_layout.nb_channels) {
+ av_channel_layout_uninit(&st->codecpar->ch_layout);
+ st->codecpar->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
+ st->codecpar->ch_layout.nb_channels = cfg.channels;
+ }
if (cfg.object_type == 29 && cfg.sampling_index < 3) // old mp3on4
st->codecpar->sample_rate = ff_mpa_freq_tab[cfg.sampling_index];
else if (cfg.ext_sample_rate)