Browse Source

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>
master
James Almer 4 years ago
parent
commit
03e767790c
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      libavformat/mpegts.c
  2. +1
    -1
      tests/ref/fate/ts-opus-demux

+ 1
- 0
libavformat/mpegts.c 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");
}


+ 1
- 1
tests/ref/fate/ts-opus-demux 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


Loading…
Cancel
Save