Browse Source

mlp_parser: fix request_channel_layout behavior.

When request_channel_layout is 0,
all substreams should be decoded.

Thanks to Michael Niedermayer for spotting.

Also fix a mismatch between the parser and
decoder when request_channel_layout is a
subset of Stereo.
tags/n2.2-rc1
Tim Walker 11 years ago
parent
commit
c1e7de8f62
1 changed files with 10 additions and 5 deletions
  1. +10
    -5
      libavcodec/mlp_parser.c

+ 10
- 5
libavcodec/mlp_parser.c View File

@@ -335,7 +335,9 @@ FF_DISABLE_DEPRECATION_WARNINGS
} else } else
FF_ENABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS
#endif #endif
if (avctx->request_channel_layout == AV_CH_LAYOUT_STEREO &&
if (avctx->request_channel_layout &&
(avctx->request_channel_layout & AV_CH_LAYOUT_STEREO) ==
avctx->request_channel_layout &&
mh.num_substreams > 1) { mh.num_substreams > 1) {
avctx->channels = 2; avctx->channels = 2;
avctx->channel_layout = AV_CH_LAYOUT_STEREO; avctx->channel_layout = AV_CH_LAYOUT_STEREO;
@@ -358,13 +360,16 @@ FF_DISABLE_DEPRECATION_WARNINGS
} else } else
FF_ENABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS
#endif #endif
if (avctx->request_channel_layout == AV_CH_LAYOUT_STEREO &&
mh.num_substreams > 1) {
if (avctx->request_channel_layout &&
(avctx->request_channel_layout & AV_CH_LAYOUT_STEREO) ==
avctx->request_channel_layout &&
mh.num_substreams > 1) {
avctx->channels = 2; avctx->channels = 2;
avctx->channel_layout = AV_CH_LAYOUT_STEREO; avctx->channel_layout = AV_CH_LAYOUT_STEREO;
} else if (!mh.channels_thd_stream2 || } else if (!mh.channels_thd_stream2 ||
(mh.channel_layout_thd_stream1 & avctx->request_channel_layout) ==
avctx->request_channel_layout) {
(avctx->request_channel_layout &&
(avctx->request_channel_layout & mh.channel_layout_thd_stream1) ==
avctx->request_channel_layout)) {
avctx->channels = mh.channels_thd_stream1; avctx->channels = mh.channels_thd_stream1;
avctx->channel_layout = mh.channel_layout_thd_stream1; avctx->channel_layout = mh.channel_layout_thd_stream1;
} else { } else {


Loading…
Cancel
Save