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
341341 return AVERROR(EINVAL);
342342 }
343343
344− if (s->channel_layout_str) {
344+ if (s->channel_layout_str || s->channel_layout) {
345345 int n;
346346
347− s->channel_layout = av_get_channel_layout(s->channel_layout_str);
348347 if (!s->channel_layout) {
349− av_log(ctx, AV_LOG_ERROR, "Invalid channel layout %s.\n",
350− s->channel_layout_str);
351− return AVERROR(EINVAL);
348+ s->channel_layout = av_get_channel_layout(s->channel_layout_str);
349+ if (!s->channel_layout) {
350+ av_log(ctx, AV_LOG_ERROR, "Invalid channel layout %s.\n",
351+ s->channel_layout_str);
352+ return AVERROR(EINVAL);
353+ }
352354 }
353355 n = av_get_channel_layout_nb_channels(s->channel_layout);
354356 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