summaryrefslogtreecommitdiff
path: root/libavfilter/buffersrc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavfilter/buffersrc.c')
-rw-r--r--libavfilter/buffersrc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
index 77fd174219..3f80d5f413 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) {