summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/ffmpeg/libavcodec/mlp_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/ffmpeg/libavcodec/mlp_parser.c')
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mlp_parser.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/chromium/third_party/ffmpeg/libavcodec/mlp_parser.c b/chromium/third_party/ffmpeg/libavcodec/mlp_parser.c
index fcd11680761..dae19e756b2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mlp_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mlp_parser.c
@@ -170,14 +170,17 @@ int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
mh->group1_samplerate = mlp_samplerate(ratebits);
mh->group2_samplerate = 0;
- skip_bits(gb, 8);
+ skip_bits(gb, 4);
+
+ mh->channel_modifier_thd_stream0 = get_bits(gb, 2);
+ mh->channel_modifier_thd_stream1 = get_bits(gb, 2);
mh->channel_arrangement=
channel_arrangement = get_bits(gb, 5);
mh->channels_thd_stream1 = truehd_channels(channel_arrangement);
mh->channel_layout_thd_stream1 = ff_truehd_layout(channel_arrangement);
- skip_bits(gb, 2);
+ mh->channel_modifier_thd_stream2 = get_bits(gb, 2);
channel_arrangement = get_bits(gb, 13);
mh->channels_thd_stream2 = truehd_channels(channel_arrangement);
@@ -340,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;
@@ -363,12 +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 (avctx->request_channel_layout == mh.channel_layout_thd_stream1 ||
- !mh.channels_thd_stream2) {
+ } else if (!mh.channels_thd_stream2 ||
+ (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 {