summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-12-20 19:08:39 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-12-20 19:15:11 +0100
commit5318cf521f66cd58642c07e8036f6232d4c60ed2 (patch)
tree5a2ca7a5beae44353f2d7621f0a0073cf9c33785 /libavformat
parent988ca9bd53c0bd240383ccf7b0ca0eb7224a8ff5 (diff)
parent9cfa68c560bdec82d2d5ec079f9c5b0f9ca37af0 (diff)
Merge commit '9cfa68c560bdec82d2d5ec079f9c5b0f9ca37af0'
* commit '9cfa68c560bdec82d2d5ec079f9c5b0f9ca37af0': mpegts: add support for Opus Conflicts: libavcodec/opus_parser.c libavformat/mpegts.c See: 74141f693ded2fbf75af56fff309d2db35183635 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mpegts.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index f7f484e133..f61388b5c1 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1515,6 +1515,10 @@ static const uint8_t opus_coupled_stream_cnt[9] = {
1, 0, 1, 1, 2, 2, 2, 3, 3
};
+static const uint8_t opus_stream_cnt[9] = {
+ 1, 1, 1, 2, 2, 3, 4, 4, 5,
+};
+
static const uint8_t opus_channel_map[8][8] = {
{ 0 },
{ 0,1 },
@@ -1760,11 +1764,8 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
return AVERROR_INVALIDDATA;
if (channel_config_code <= 0x8) {
st->codec->extradata[9] = channels = channel_config_code ? channel_config_code : 2;
- st->codec->extradata[18] = channels > 2;
- st->codec->extradata[19] = channels - opus_coupled_stream_cnt[channel_config_code];
- if (channel_config_code == 0) { /* Dual Mono */
- st->codec->extradata[18] = 255; /* Mapping */
- }
+ st->codec->extradata[18] = channel_config_code ? (channels > 2) : /* Dual Mono */ 255;
+ st->codec->extradata[19] = opus_stream_cnt[channel_config_code];
st->codec->extradata[20] = opus_coupled_stream_cnt[channel_config_code];
memcpy(&st->codec->extradata[21], opus_channel_map[channels - 1], channels);
} else {