Commit 42959044 authored by Rostislav Pehlivanov's avatar Rostislav Pehlivanov

lavfi/buffersrc: fix directly setting channel layout

When setting the channel layout directly using AVBufferSrcParameters
the channel layout was correctly set however the init function still
expected the old string format to set the number of channels (when it
hadn't already been specified).
Signed-off-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
parent 0c0aef1c
......@@ -341,15 +341,17 @@ static av_cold int init_audio(AVFilterContext *ctx)
return AVERROR(EINVAL);
}
if (s->channel_layout_str) {
if (s->channel_layout_str || s->channel_layout) {
int n;
if (!s->channel_layout) {
s->channel_layout = av_get_channel_layout(s->channel_layout_str);
if (!s->channel_layout) {
av_log(ctx, AV_LOG_ERROR, "Invalid channel layout %s.\n",
s->channel_layout_str);
return AVERROR(EINVAL);
}
}
n = av_get_channel_layout_nb_channels(s->channel_layout);
if (s->channels) {
if (n != s->channels) {
......
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