[FFmpeg-cvslog] avformat/mpegts: set correct extradata size for Opus streams

James Almer git at videolan.org
Fri Apr 16 17:15:15 EEST 2021


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Thu Apr 15 00:35:57 2021 -0300| [03e767790cac0daa10edd72fb6870bf74f79bf6a] | committer: James Almer

avformat/mpegts: set correct extradata size for Opus streams

map_type 0 is always 19 bytes, whereas map_type 1 and 255 are 21 + channel
count bytes.

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=03e767790cac0daa10edd72fb6870bf74f79bf6a
---

 libavformat/mpegts.c         | 1 +
 tests/ref/fate/ts-opus-demux | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 2c3b9be434..f947e2cbb1 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -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");
                 }
diff --git a/tests/ref/fate/ts-opus-demux b/tests/ref/fate/ts-opus-demux
index 37534350a1..f5c423389b 100644
--- a/tests/ref/fate/ts-opus-demux
+++ b/tests/ref/fate/ts-opus-demux
@@ -1,4 +1,4 @@
-#extradata 0:       30, 0x69290482
+#extradata 0:       29, 0x64a70482
 #tb 0: 1/90000
 #media_type 0: audio
 #codec_id 0: opus



More information about the ffmpeg-cvslog mailing list