History

Merge commit 'b01f6041f4260fba053c2f96ce1611ea77e833a0'

* commit 'b01f6041f4260fba053c2f96ce1611ea77e833a0': lavfi: rename AVFilterFormats.format_count to nb_formats Conflicts: libavfilter/avfiltergraph.c libavfilter/filtfmts.c libavfilter/formats.c

Michael Niedermayer committed 13 years ago

Commit 74cb7ef2 parents 937af7f b01f6046 files · +29 −29Browse files

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

Unified · Split

libavfilter/avfiltergraph.c+15−15
@@ -503,28 +503,28 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref) · 502 unmodified lines
503503 int has_alpha= av_pix_fmt_desc_get(ref->format)->nb_components % 2 == 0;
504504 enum AVPixelFormat best= AV_PIX_FMT_NONE;
505505 int i;
506− for (i=0; i<link->in_formats->format_count; i++) {
506+ for (i=0; i<link->in_formats->nb_formats; i++) {
507507 enum AVPixelFormat p = link->in_formats->formats[i];
508508 best= avcodec_find_best_pix_fmt_of_2(best, p, ref->format, has_alpha, NULL);
509509 }
510510 av_log(link->src,AV_LOG_DEBUG, "picking %s out of %d ref:%s alpha:%d\n",
511− av_get_pix_fmt_name(best), link->in_formats->format_count,
511+ av_get_pix_fmt_name(best), link->in_formats->nb_formats,
512512 av_get_pix_fmt_name(ref->format), has_alpha);
513513 link->in_formats->formats[0] = best;
514514 }
515515 }
516516
517− link->in_formats->format_count = 1;
517+ link->in_formats->nb_formats = 1;
518518 link->format = link->in_formats->formats[0];
519519
520520 if (link->type == AVMEDIA_TYPE_AUDIO) {
521− if (!link->in_samplerates->format_count) {
521+ if (!link->in_samplerates->nb_formats) {
522522 av_log(link->src, AV_LOG_ERROR, "Cannot select sample rate for"
523523 " the link between filters %s and %s.\n", link->src->name,
524524 link->dst->name);
525525 return AVERROR(EINVAL);
526526 }
527− link->in_samplerates->format_count = 1;
527+ link->in_samplerates->nb_formats = 1;
528528 link->sample_rate = link->in_samplerates->formats[0];
529529
530530 if (link->in_channel_layouts->all_layouts) {
@@ -591,9 +591,9 @@ static int reduce_formats_on_filter(AVFilterContext *filter) · 60 unmodified lines
591591 int i, j, k, ret = 0;
592592
593593 REDUCE_FORMATS(int, AVFilterFormats, formats, formats,
594− format_count, ff_add_format);
594+ nb_formats, ff_add_format);
595595 REDUCE_FORMATS(int, AVFilterFormats, samplerates, formats,
596− format_count, ff_add_format);
596+ nb_formats, ff_add_format);
597597
598598 /* reduce channel layouts */
599599 for (i = 0; i < filter->nb_inputs; i++) {
@@ -656,7 +656,7 @@ static void swap_samplerates_on_filter(AVFilterContext *filter) · 56 unmodified lines
656656 link = filter->inputs[i];
657657
658658 if (link->type == AVMEDIA_TYPE_AUDIO &&
659− link->out_samplerates->format_count == 1)
659+ link->out_samplerates->nb_formats== 1)
660660 break;
661661 }
662662 if (i == filter->nb_inputs)
@@ -669,10 +669,10 @@ static void swap_samplerates_on_filter(AVFilterContext *filter) · 6 unmodified lines
669669 int best_idx, best_diff = INT_MAX;
670670
671671 if (outlink->type != AVMEDIA_TYPE_AUDIO ||
672− outlink->in_samplerates->format_count < 2)
672+ outlink->in_samplerates->nb_formats < 2)
673673 continue;
674674
675− for (j = 0; j < outlink->in_samplerates->format_count; j++) {
675+ for (j = 0; j < outlink->in_samplerates->nb_formats; j++) {
676676 int diff = abs(sample_rate - outlink->in_samplerates->formats[j]);
677677
678678 if (diff < best_diff) {
@@ -834,7 +834,7 @@ static void swap_sample_fmts_on_filter(AVFilterContext *filter) · 155 unmodified lines
834834 link = filter->inputs[i];
835835
836836 if (link->type == AVMEDIA_TYPE_AUDIO &&
837− link->out_formats->format_count == 1)
837+ link->out_formats->nb_formats == 1)
838838 break;
839839 }
840840 if (i == filter->nb_inputs)
@@ -848,10 +848,10 @@ static void swap_sample_fmts_on_filter(AVFilterContext *filter) · 7 unmodified lines
848848 int best_idx = -1, best_score = INT_MIN;
849849
850850 if (outlink->type != AVMEDIA_TYPE_AUDIO ||
851− outlink->in_formats->format_count < 2)
851+ outlink->in_formats->nb_formats < 2)
852852 continue;
853853
854− for (j = 0; j < outlink->in_formats->format_count; j++) {
854+ for (j = 0; j < outlink->in_formats->nb_formats; j++) {
855855 int out_format = outlink->in_formats->formats[j];
856856 int out_bps = av_get_bytes_per_sample(out_format);
857857 int score;
@@ -904,7 +904,7 @@ static int pick_formats(AVFilterGraph *graph) · 46 unmodified lines
904904 AVFilterContext *filter = graph->filters[i];
905905 if (filter->nb_inputs){
906906 for (j = 0; j < filter->nb_inputs; j++){
907− if(filter->inputs[j]->in_formats && filter->inputs[j]->in_formats->format_count == 1) {
907+ if(filter->inputs[j]->in_formats && filter->inputs[j]->in_formats->nb_formats == 1) {
908908 if ((ret = pick_format(filter->inputs[j], NULL)) < 0)
909909 return ret;
910910 change = 1;
@@ -913,7 +913,7 @@ static int pick_formats(AVFilterGraph *graph) · 2 unmodified lines
913913 }
914914 if (filter->nb_outputs){
915915 for (j = 0; j < filter->nb_outputs; j++){
916− if(filter->outputs[j]->in_formats && filter->outputs[j]->in_formats->format_count == 1) {
916+ if(filter->outputs[j]->in_formats && filter->outputs[j]->in_formats->nb_formats == 1) {
917917 if ((ret = pick_format(filter->outputs[j], NULL)) < 0)
918918 return ret;
919919 change = 1;

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