summaryrefslogtreecommitdiff
path: root/libavcodec/mlp_parser.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-10-30 17:20:45 -0300
committerJames Almer <jamrial@gmail.com>2017-10-30 17:20:45 -0300
commit34542ac033f81601fd4dd684e993cc1716bb9a4d (patch)
tree06aa634cdc41b96b0f7bfc97f634ab73f1bcd99f /libavcodec/mlp_parser.c
parent9484b9f4ba66a96b9b565f33f1eeb6e9b9b79e96 (diff)
parent970c76f32283bddf3a5afd24fe52db7a96186244 (diff)
Merge commit '970c76f32283bddf3a5afd24fe52db7a96186244'
* commit '970c76f32283bddf3a5afd24fe52db7a96186244': mlp_parser: Drop in-parser downmix functionality Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/mlp_parser.c')
-rw-r--r--libavcodec/mlp_parser.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c
index 379c644e36..3c0330f777 100644
--- a/libavcodec/mlp_parser.c
+++ b/libavcodec/mlp_parser.c
@@ -119,11 +119,6 @@ uint64_t ff_truehd_layout(int chanmap)
return layout;
}
-int ff_mlp_channel_layout_subset(uint64_t channel_layout, uint64_t mask)
-{
- return channel_layout && ((channel_layout & mask) == channel_layout);
-}
-
static int mlp_get_major_sync_size(const uint8_t * buf, int bufsize)
{
int has_extension, extensions = 0;
@@ -346,8 +341,6 @@ static int mlp_parse(AVCodecParserContext *s,
} else {
GetBitContext gb;
MLPHeaderInfo mh;
- int stereo_requested = ff_mlp_channel_layout_subset(avctx->request_channel_layout,
- AV_CH_LAYOUT_STEREO);
init_get_bits(&gb, buf + 4, (buf_size - 4) << 3);
if (ff_mlp_read_major_sync(avctx, &mh, &gb) < 0)
@@ -364,21 +357,11 @@ static int mlp_parse(AVCodecParserContext *s,
if(!avctx->channels || !avctx->channel_layout) {
if (mh.stream_type == 0xbb) {
/* MLP stream */
- if (stereo_requested && mh.num_substreams > 1) {
- avctx->channels = 2;
- avctx->channel_layout = AV_CH_LAYOUT_STEREO;
- } else {
- avctx->channels = mh.channels_mlp;
- avctx->channel_layout = mh.channel_layout_mlp;
- }
+ avctx->channels = mh.channels_mlp;
+ avctx->channel_layout = mh.channel_layout_mlp;
} else { /* mh.stream_type == 0xba */
/* TrueHD stream */
- if (stereo_requested && mh.num_substreams > 1) {
- avctx->channels = 2;
- avctx->channel_layout = AV_CH_LAYOUT_STEREO;
- } else if (!mh.channels_thd_stream2 ||
- ff_mlp_channel_layout_subset(avctx->request_channel_layout,
- mh.channel_layout_thd_stream1)) {
+ if (!mh.channels_thd_stream2) {
avctx->channels = mh.channels_thd_stream1;
avctx->channel_layout = mh.channel_layout_thd_stream1;
} else {