This is more consistent with naming in the rest of Libav.
Showing the changes to libavfilter/avfiltergraph.c (1 of 5 files). Show all
Unified · Split
| @@ -341,17 +341,17 @@ static int pick_format(AVFilterLink *link) · 340 unmodified lines | ||
| 341 | 341 | if (!link || !link->in_formats) |
| 342 | 342 | return 0; |
| 343 | 343 | |
| 344 | − link->in_formats->format_count = 1; | |
| 344 | + link->in_formats->nb_formats = 1; | |
| 345 | 345 | link->format = link->in_formats->formats[0]; |
| 346 | 346 | |
| 347 | 347 | if (link->type == AVMEDIA_TYPE_AUDIO) { |
| 348 | − if (!link->in_samplerates->format_count) { | |
| 348 | + if (!link->in_samplerates->nb_formats) { | |
| 349 | 349 | av_log(link->src, AV_LOG_ERROR, "Cannot select sample rate for" |
| 350 | 350 | " the link between filters %s and %s.\n", link->src->name, |
| 351 | 351 | link->dst->name); |
| 352 | 352 | return AVERROR(EINVAL); |
| 353 | 353 | } |
| 354 | − link->in_samplerates->format_count = 1; | |
| 354 | + link->in_samplerates->nb_formats = 1; | |
| 355 | 355 | link->sample_rate = link->in_samplerates->formats[0]; |
| 356 | 356 | |
| 357 | 357 | if (!link->in_channel_layouts->nb_channel_layouts) { |
| @@ -414,9 +414,9 @@ static int reduce_formats_on_filter(AVFilterContext *filter) · 56 unmodified lines | ||
| 414 | 414 | int i, j, k, ret = 0; |
| 415 | 415 | |
| 416 | 416 | REDUCE_FORMATS(int, AVFilterFormats, formats, formats, |
| 417 | − format_count, ff_add_format); | |
| 417 | + nb_formats, ff_add_format); | |
| 418 | 418 | REDUCE_FORMATS(int, AVFilterFormats, samplerates, formats, |
| 419 | − format_count, ff_add_format); | |
| 419 | + nb_formats, ff_add_format); | |
| 420 | 420 | REDUCE_FORMATS(uint64_t, AVFilterChannelLayouts, channel_layouts, |
| 421 | 421 | channel_layouts, nb_channel_layouts, ff_add_channel_layout); |
| 422 | 422 | |
| @@ -445,7 +445,7 @@ static void swap_samplerates_on_filter(AVFilterContext *filter) · 22 unmodified lines | ||
| 445 | 445 | link = filter->inputs[i]; |
| 446 | 446 | |
| 447 | 447 | if (link->type == AVMEDIA_TYPE_AUDIO && |
| 448 | − link->out_samplerates->format_count == 1) | |
| 448 | + link->out_samplerates->nb_formats== 1) | |
| 449 | 449 | break; |
| 450 | 450 | } |
| 451 | 451 | if (i == filter->nb_inputs) |
| @@ -458,10 +458,10 @@ static void swap_samplerates_on_filter(AVFilterContext *filter) · 6 unmodified lines | ||
| 458 | 458 | int best_idx, best_diff = INT_MAX; |
| 459 | 459 | |
| 460 | 460 | if (outlink->type != AVMEDIA_TYPE_AUDIO || |
| 461 | − outlink->in_samplerates->format_count < 2) | |
| 461 | + outlink->in_samplerates->nb_formats < 2) | |
| 462 | 462 | continue; |
| 463 | 463 | |
| 464 | − for (j = 0; j < outlink->in_samplerates->format_count; j++) { | |
| 464 | + for (j = 0; j < outlink->in_samplerates->nb_formats; j++) { | |
| 465 | 465 | int diff = abs(sample_rate - outlink->in_samplerates->formats[j]); |
| 466 | 466 | |
| 467 | 467 | if (diff < best_diff) { |
| @@ -607,7 +607,7 @@ static void swap_sample_fmts_on_filter(AVFilterContext *filter) · 139 unmodified lines | ||
| 607 | 607 | link = filter->inputs[i]; |
| 608 | 608 | |
| 609 | 609 | if (link->type == AVMEDIA_TYPE_AUDIO && |
| 610 | − link->out_formats->format_count == 1) | |
| 610 | + link->out_formats->nb_formats == 1) | |
| 611 | 611 | break; |
| 612 | 612 | } |
| 613 | 613 | if (i == filter->nb_inputs) |
| @@ -621,10 +621,10 @@ static void swap_sample_fmts_on_filter(AVFilterContext *filter) · 7 unmodified lines | ||
| 621 | 621 | int best_idx = -1, best_score = INT_MIN; |
| 622 | 622 | |
| 623 | 623 | if (outlink->type != AVMEDIA_TYPE_AUDIO || |
| 624 | − outlink->in_formats->format_count < 2) | |
| 624 | + outlink->in_formats->nb_formats < 2) | |
| 625 | 625 | continue; |
| 626 | 626 | |
| 627 | − for (j = 0; j < outlink->in_formats->format_count; j++) { | |
| 627 | + for (j = 0; j < outlink->in_formats->nb_formats; j++) { | |
| 628 | 628 | int out_format = outlink->in_formats->formats[j]; |
| 629 | 629 | int out_bps = av_get_bytes_per_sample(out_format); |
| 630 | 630 | int score; |