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>
This commit is contained in:
James Almer 2021-04-15 00:35:57 -03:00
parent c1fd4033dc
commit 03e767790c
2 changed files with 2 additions and 1 deletions

View 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");
}

View 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