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
2031 st->codecpar->extradata[19] = opus_stream_cnt[channel_config_code];2031 st->codecpar->extradata[19] = opus_stream_cnt[channel_config_code];
2032 st->codecpar->extradata[20] = opus_coupled_stream_cnt[channel_config_code];2032 st->codecpar->extradata[20] = opus_coupled_stream_cnt[channel_config_code];
2033 memcpy(&st->codecpar->extradata[21], opus_channel_map[channels - 1], channels);2033 memcpy(&st->codecpar->extradata[21], opus_channel_map[channels - 1], channels);
2034 st->codecpar->extradata_size = st->codecpar->extradata[18] ? 21 + channels : 19;
2034 } else {2035 } else {
2035 avpriv_request_sample(fc, "Opus in MPEG-TS - channel_config_code > 0x8");2036 avpriv_request_sample(fc, "Opus in MPEG-TS - channel_config_code > 0x8");
2036 }2037 }
tests/ref/fate/ts-opus-demux+1−1
@@ -1,4 +1,4 @@
1#extradata 0: 30, 0x692904821#extradata 0: 29, 0x64a70482
2#tb 0: 1/900002#tb 0: 1/90000
3#media_type 0: audio3#media_type 0: audio
4#codec_id 0: opus4#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