diff options
author | James Almer <jamrial@gmail.com> | 2021-04-15 00:35:57 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2021-04-16 11:08:40 -0300 |
commit | 03e767790cac0daa10edd72fb6870bf74f79bf6a (patch) | |
tree | e3e853a77fd46fe5f9ac641a14e443c4c20dbb1b | |
parent | c1fd4033dca192d709ff01203aa833256df5b70f (diff) |
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@gmail.com>
-rw-r--r-- | libavformat/mpegts.c | 1 | ||||
-rw-r--r-- | tests/ref/fate/ts-opus-demux | 2 |
2 files changed, 2 insertions, 1 deletions
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 |