History

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).

Rostislav Pehlivanov committed 9 years ago

Commit 42959041 parent 0c0aef11 file · +7 −5Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/buffersrc.c+7−5
@@ -341,14 +341,16 @@ static av_cold int init_audio(AVFilterContext *ctx) · 340 unmodified lines
341 return AVERROR(EINVAL);341 return AVERROR(EINVAL);
342 }342 }
343 343
344 if (s->channel_layout_str) {344 if (s->channel_layout_str || s->channel_layout) {
345 int n;345 int n;
346 346
347 s->channel_layout = av_get_channel_layout(s->channel_layout_str);
348 if (!s->channel_layout) {347 if (!s->channel_layout) {
349 av_log(ctx, AV_LOG_ERROR, "Invalid channel layout %s.\n",348 s->channel_layout = av_get_channel_layout(s->channel_layout_str);
350 s->channel_layout_str);349 if (!s->channel_layout) {
351 return AVERROR(EINVAL);350 av_log(ctx, AV_LOG_ERROR, "Invalid channel layout %s.\n",
351 s->channel_layout_str);
352 return AVERROR(EINVAL);
353 }
352 }354 }
353 n = av_get_channel_layout_nb_channels(s->channel_layout);355 n = av_get_channel_layout_nb_channels(s->channel_layout);
354 if (s->channels) {356 if (s->channels) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t