]> git.sesse.net Git - ffmpeg/commitdiff
avformat/mpegts: set correct extradata size for Opus streams
authorJames Almer <jamrial@gmail.com>
Thu, 15 Apr 2021 03:35:57 +0000 (00:35 -0300)
committerJames Almer <jamrial@gmail.com>
Fri, 16 Apr 2021 14:08:40 +0000 (11:08 -0300)
map_type 0 is always 19 bytes, whereas map_type 1 and 255 are 21 + channel
count bytes.

Signed-off-by: James Almer <jamrial@gmail.com>
libavformat/mpegts.c
tests/ref/fate/ts-opus-demux

index 2c3b9be4348f014ef551d553f22fd497a42cbf0d..f947e2cbb19a78d2a1c31c22c211ff30fdf01996 100644 (file)
@@ -2031,6 +2031,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
                     st->codecpar->extradata[19] = opus_stream_cnt[channel_config_code];
                     st->codecpar->extradata[20] = opus_coupled_stream_cnt[channel_config_code];
                     memcpy(&st->codecpar->extradata[21], opus_channel_map[channels - 1], channels);
+                    st->codecpar->extradata_size = st->codecpar->extradata[18] ? 21 + channels : 19;
                 } else {
                     avpriv_request_sample(fc, "Opus in MPEG-TS - channel_config_code > 0x8");
                 }
index 37534350a1f0d9fefd11f7cea9760bc4cbce43da..f5c423389bcada5c03fdbaa4cfd6a52dfe762e85 100644 (file)
@@ -1,4 +1,4 @@
-#extradata 0:       30, 0x69290482
+#extradata 0:       29, 0x64a70482
 #tb 0: 1/90000
 #media_type 0: audio
 #codec_id 0: opus