Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/mlp_parser.c')
-rw-r--r--libavcodec/mlp_parser.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c
index 39dbcf9673..dae19e756b 100644
--- a/libavcodec/mlp_parser.c
+++ b/libavcodec/mlp_parser.c
@@ -343,7 +343,9 @@ FF_DISABLE_DEPRECATION_WARNINGS
FF_ENABLE_DEPRECATION_WARNINGS
} else
#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) {
avctx->channels = 2;
avctx->channel_layout = AV_CH_LAYOUT_STEREO;
@@ -366,13 +368,16 @@ FF_DISABLE_DEPRECATION_WARNINGS
FF_ENABLE_DEPRECATION_WARNINGS
} else
#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->channel_layout = AV_CH_LAYOUT_STEREO;
} 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 &&
+ (avctx->request_channel_layout & mh.channel_layout_thd_stream1) ==
+ avctx->request_channel_layout)) {
avctx->channels = mh.channels_thd_stream1;
avctx->channel_layout = mh.channel_layout_thd_stream1;
} else {