aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mlp_parser.c
diff options
context:
space:
mode:
authorTim Walker <tdskywalker@gmail.com>2014-02-06 21:50:38 +0000
committerTim Walker <tdskywalker@gmail.com>2014-02-08 13:39:37 +0100
commitc0c45188e56cfa3050bb39f8299025345b8a204c (patch)
treec02e7479d5764ae40c43053f4c7161a476e259f4 /libavcodec/mlp_parser.c
parent5c1c6e82261b856214499b9fef3a08bf3ff6e0ae (diff)
downloadffmpeg-c0c45188e56cfa3050bb39f8299025345b8a204c.tar.gz
mlp: improve request_channel_layout behavior.
Don't decode further substreams if request_channel_layout is a subset of the current substream's channel_layout. Before, we would only discard further substreams if request_channel_layout matched the substream's channel_layout extactly, thus decoding additional channels which the caller would probably end up downmixing.
Diffstat (limited to 'libavcodec/mlp_parser.c')
-rw-r--r--libavcodec/mlp_parser.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c
index 8766bd0c1f..a30cd05dc5 100644
--- a/libavcodec/mlp_parser.c
+++ b/libavcodec/mlp_parser.c
@@ -362,8 +362,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
mh.num_substreams > 1) {
avctx->channels = 2;
avctx->channel_layout = AV_CH_LAYOUT_STEREO;
- } else if (avctx->request_channel_layout == mh.channel_layout_thd_stream1 ||
- !mh.channels_thd_stream2) {
+ } else if (!mh.channels_thd_stream2 ||
+ (mh.channel_layout_thd_stream1 & avctx->request_channel_layout) ==
+ avctx->request_channel_layout) {
avctx->channels = mh.channels_thd_stream1;
avctx->channel_layout = mh.channel_layout_thd_stream1;
} else {