summaryrefslogtreecommitdiff
path: root/libavcodec/mlpdec.c
diff options
context:
space:
mode:
authorTim Walker <tdskywalker@gmail.com>2012-12-31 15:33:27 +0100
committerJustin Ruggles <justin.ruggles@gmail.com>2013-01-22 16:10:02 -0500
commited1b01131e662c9086b27aaaea69684d8575fbea (patch)
tree0f628ceb968766ac02ddda422aeb2cdeaa92d6c2 /libavcodec/mlpdec.c
parentb0c7e3ffd09f68022429920da483ad7abed84aa1 (diff)
mlp: implement support for AVCodecContext.request_channel_layout.
Also wrap usage of AVCodecContext.request_channels in FF_API_REQUEST_CHANNELS directives. Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
Diffstat (limited to 'libavcodec/mlpdec.c')
-rw-r--r--libavcodec/mlpdec.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index 80ff4017f7..c0174b49b6 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -445,14 +445,24 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
return AVERROR_INVALIDDATA;
}
- if (m->avctx->request_channels > 0
- && s->max_channel + 1 >= m->avctx->request_channels
- && substr < m->max_decoded_substream) {
+#if FF_API_REQUEST_CHANNELS
+ if (m->avctx->request_channels > 0 &&
+ m->avctx->request_channels <= s->max_channel + 1 &&
+ m->max_decoded_substream > substr) {
av_log(m->avctx, AV_LOG_DEBUG,
- "Extracting %d channel downmix from substream %d. "
+ "Extracting %d-channel downmix from substream %d. "
"Further substreams will be skipped.\n",
s->max_channel + 1, substr);
m->max_decoded_substream = substr;
+ } else
+#endif
+ if (m->avctx->request_channel_layout == s->ch_layout &&
+ m->max_decoded_substream > substr) {
+ av_log(m->avctx, AV_LOG_DEBUG,
+ "Extracting %d-channel downmix (0x%"PRIx64") from substream %d. "
+ "Further substreams will be skipped.\n",
+ s->max_channel + 1, s->ch_layout, substr);
+ m->max_decoded_substream = substr;
}
s->noise_shift = get_bits(gbp, 4);