Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2017-02-21 09:51:46 +0300
committerRostislav Pehlivanov <atomnuker@gmail.com>2017-02-21 19:40:53 +0300
commit5546294f63e4ce52535eddd8772a00a27e542bf5 (patch)
tree4f84cc5225b73730d63e51646eff93732720201d /libavfilter
parente93e215b36ab3dcbb4a9aa4daae6625b71a87c72 (diff)
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>
Diffstat (limited to 'libavfilter')
-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) {