History

lavfi: rename AVFilterFormats.format_count to nb_formats

This is more consistent with naming in the rest of Libav.

Anton Khirnov committed 13 years ago

Commit b01f6041 parent e27f4b75 files · +21 −21Browse files

Showing the changes to libavfilter/avfiltergraph.c (1 of 5 files). Show all

Unified · Split

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

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