summaryrefslogtreecommitdiff
path: root/libavcodec/mlpdec.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2017-04-26 11:08:17 -0400
committerVittorio Giovara <vittorio.giovara@gmail.com>2017-04-27 14:19:54 -0400
commit970c76f32283bddf3a5afd24fe52db7a96186244 (patch)
tree8cb1e90fd6e480ef48cfd8ed89977b21a8ed04ad /libavcodec/mlpdec.c
parentdd3aa85b68c017c419acb0c39ff6aa890ce89e87 (diff)
mlp_parser: Drop in-parser downmix functionality
request_channel_layout is a decoder option and it makes no sense to have it in a parser. This feature was needed in the past when the decoder was allowed to reuse the avctx from the demuxer. Nowadays the decoder receives only the parameters from it, already containing the real channel layout (and the correct request_channel_layout option). After initialization the decoder overwrites the channel layout with the downmixed one that is actually output, so there is no need to preserve this functionality in the parser. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/mlpdec.c')
-rw-r--r--libavcodec/mlpdec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index fa94f6f5b4..4f6675a3ca 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -178,6 +178,11 @@ static const uint64_t thd_channel_order[] = {
AV_CH_LOW_FREQUENCY_2, // LFE2
};
+static int mlp_channel_layout_subset(uint64_t channel_layout, uint64_t mask)
+{
+ return channel_layout && ((channel_layout & mask) == channel_layout);
+}
+
static uint64_t thd_channel_layout_extract_channel(uint64_t channel_layout,
int index)
{
@@ -511,7 +516,7 @@ static int read_restart_header(MLPDecodeContext *m, BitstreamContext *bc,
s->max_channel = max_channel;
s->max_matrix_channel = max_matrix_channel;
- if (ff_mlp_channel_layout_subset(m->avctx->request_channel_layout, s->mask) &&
+ if (mlp_channel_layout_subset(m->avctx->request_channel_layout, s->mask) &&
m->max_decoded_substream > substr) {
av_log(m->avctx, AV_LOG_DEBUG,
"Extracting %d-channel downmix (0x%"PRIx64") from substream %d. "