These checks emit warnings in case the channel layouts lists are inconsistent; yet since 69f5f6ea375950b4845b241ee27054bfc8f00343 a function that is called earlier errors out if they are inconsistent.
Showing the changes to libavfilter/avfiltergraph.c (1 of 1 file). Show all
Unified · Split
| @@ -295,21 +295,6 @@ AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, const char *nam · 294 unmodified lines | |||
| 295 | return NULL; | 295 | return NULL; |
| 296 | } | 296 | } |
| 297 | 297 | ||
| 298 | static void sanitize_channel_layouts(void *log, AVFilterChannelLayouts *l) | ||
| 299 | { | ||
| 300 | if (!l) | ||
| 301 | return; | ||
| 302 | if (l->nb_channel_layouts) { | ||
| 303 | if (l->all_layouts || l->all_counts) | ||
| 304 | av_log(log, AV_LOG_WARNING, "All layouts set on non-empty list\n"); | ||
| 305 | l->all_layouts = l->all_counts = 0; | ||
| 306 | } else { | ||
| 307 | if (l->all_counts && !l->all_layouts) | ||
| 308 | av_log(log, AV_LOG_WARNING, "All counts without all layouts\n"); | ||
| 309 | l->all_layouts = 1; | ||
| 310 | } | ||
| 311 | } | ||
| 312 | |||
| 313 | static int filter_link_check_formats(void *log, AVFilterLink *link, AVFilterFormatsConfig *cfg) | 298 | static int filter_link_check_formats(void *log, AVFilterLink *link, AVFilterFormatsConfig *cfg) |
| 314 | { | 299 | { |
| 315 | int ret; | 300 | int ret; |
| @@ -359,7 +344,7 @@ static int filter_check_formats(AVFilterContext *ctx) · 43 unmodified lines | |||
| 359 | 344 | ||
| 360 | static int filter_query_formats(AVFilterContext *ctx) | 345 | static int filter_query_formats(AVFilterContext *ctx) |
| 361 | { | 346 | { |
| 362 | int ret, i; | 347 | int ret; |
| 363 | AVFilterFormats *formats; | 348 | AVFilterFormats *formats; |
| 364 | AVFilterChannelLayouts *chlayouts; | 349 | AVFilterChannelLayouts *chlayouts; |
| 365 | enum AVMediaType type = ctx->inputs && ctx->inputs [0] ? ctx->inputs [0]->type : | 350 | enum AVMediaType type = ctx->inputs && ctx->inputs [0] ? ctx->inputs [0]->type : |
| @@ -376,11 +361,6 @@ static int filter_query_formats(AVFilterContext *ctx) · 10 unmodified lines | |||
| 376 | if (ret < 0) | 361 | if (ret < 0) |
| 377 | return ret; | 362 | return ret; |
| 378 | 363 | ||
| 379 | for (i = 0; i < ctx->nb_inputs; i++) | ||
| 380 | sanitize_channel_layouts(ctx, ctx->inputs[i]->outcfg.channel_layouts); | ||
| 381 | for (i = 0; i < ctx->nb_outputs; i++) | ||
| 382 | sanitize_channel_layouts(ctx, ctx->outputs[i]->incfg.channel_layouts); | ||
| 383 | |||
| 384 | formats = ff_all_formats(type); | 364 | formats = ff_all_formats(type); |
| 385 | if ((ret = ff_set_common_formats(ctx, formats)) < 0) | 365 | if ((ret = ff_set_common_formats(ctx, formats)) < 0) |
| 386 | return ret; | 366 | return ret; |