X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fbuffersrc.c;h=3f80d5f413c544ecea2832a59b23827fba345794;hb=e3b81d2d9bd868c3b94a9ee1436f3a7c9de5f7c2;hp=77fd17421900accccffce1e7bfcdbb0052d0a51a;hpb=1400598c0e31dc702346224740f88b0249016f15;p=ffmpeg diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index 77fd1742190..3f80d5f413c 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -341,14 +341,16 @@ 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; - 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); + 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) {