Commit 688b09fa authored by Justin Ruggles's avatar Justin Ruggles

If AVCodecContext.channels is 0 and AVCodecContext.channel_layout is

non-zero, set channels based on channel_layout.

This allows the user to set only channel_layout and not channels.
parent 168f9e8c
......@@ -584,6 +584,8 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)
ret = AVERROR(EINVAL);
goto free_and_end;
}
} else if (avctx->channel_layout) {
avctx->channels = av_get_channel_layout_nb_channels(avctx->channel_layout);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment