Skip to content
Snippets Groups Projects
Commit c0c45188 authored by Tim Walker's avatar Tim Walker
Browse files

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.
parent 5c1c6e82
No related branches found
No related tags found
No related merge requests found
...@@ -362,8 +362,9 @@ FF_ENABLE_DEPRECATION_WARNINGS ...@@ -362,8 +362,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
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;
} else if (avctx->request_channel_layout == mh.channel_layout_thd_stream1 || } else if (!mh.channels_thd_stream2 ||
!mh.channels_thd_stream2) { (mh.channel_layout_thd_stream1 & avctx->request_channel_layout) ==
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 {
......
...@@ -504,8 +504,8 @@ FF_DISABLE_DEPRECATION_WARNINGS ...@@ -504,8 +504,8 @@ FF_DISABLE_DEPRECATION_WARNINGS
} else } else
FF_ENABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS
#endif #endif
if (m->avctx->request_channel_layout == s->ch_layout && if ((s->ch_layout & m->avctx->request_channel_layout) ==
m->max_decoded_substream > substr) { m->avctx->request_channel_layout && m->max_decoded_substream > substr) {
av_log(m->avctx, AV_LOG_DEBUG, av_log(m->avctx, AV_LOG_DEBUG,
"Extracting %d-channel downmix (0x%"PRIx64") from substream %d. " "Extracting %d-channel downmix (0x%"PRIx64") from substream %d. "
"Further substreams will be skipped.\n", "Further substreams will be skipped.\n",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment