History

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.

James Almer committed 5 years ago

Commit 03e76771 parent c1fd4032 files · +2 −1Browse files

Unified · Split

2 files
  1. libavformat/mpegts.c +1 −0
  2. tests/ref/fate/ts-opus-demux +1 −1
libavformat/mpegts.c+1−0
@@ -2031,6 +2031,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type · 2030 unmodified lines
20312031 st->codecpar->extradata[19] = opus_stream_cnt[channel_config_code];
20322032 st->codecpar->extradata[20] = opus_coupled_stream_cnt[channel_config_code];
20332033 memcpy(&st->codecpar->extradata[21], opus_channel_map[channels - 1], channels);
2034+ st->codecpar->extradata_size = st->codecpar->extradata[18] ? 21 + channels : 19;
20342035 } else {
20352036 avpriv_request_sample(fc, "Opus in MPEG-TS - channel_config_code > 0x8");
20362037 }
tests/ref/fate/ts-opus-demux+1−1
@@ -1,4 +1,4 @@
1−#extradata 0: 30, 0x69290482
1+#extradata 0: 29, 0x64a70482
22 #tb 0: 1/90000
33 #media_type 0: audio
44 #codec_id 0: opus

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t