aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2017-02-21 06:51:46 +0000
committerRostislav Pehlivanov <atomnuker@gmail.com>2017-02-21 19:02:05 +0000
commite1ed2291ecba48984a5227e3d426127427c75b7c (patch)
treef72f7ded920a2027b7fc09224445502aace434b0
parent007cf1786c8bb74297b9b0c4be0987aef608134e (diff)
downloadffmpeg-e1ed2291ecba48984a5227e3d426127427c75b7c.tar.gz
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: Rostislav Pehlivanov <atomnuker@gmail.com> (cherry picked from commit 42959044ac7dc40d5593cca2386d26257a615e5b) Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
-rw-r--r--libavfilter/buffersrc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
index 9294811d36..ba87211272 100644
--- a/libavfilter/buffersrc.c
+++ b/libavfilter/buffersrc.c
@@ -316,14 +316,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) {