History

Merge commit '42c7c61ab25809620b8c8809b3da73e25f5bbaaf'

* commit '42c7c61ab25809620b8c8809b3da73e25f5bbaaf': avfiltergraph: replace AVFilterGraph.filter_count with nb_filters Conflicts: doc/APIchanges libavfilter/avfiltergraph.c libavfilter/avfiltergraph.h libavfilter/graphparser.c libavfilter/version.h

Michael Niedermayer committed 13 years ago

Commit ecade982 parents 8a0187e 42c7c617 files · +42 −30Browse files

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

Unified · Split

libavfilter/avfiltergraph.c+20−20
@@ -62,8 +62,8 @@ void avfilter_graph_free(AVFilterGraph **graph) · 61 unmodified lines
6262 {
6363 if (!*graph)
6464 return;
65− for (; (*graph)->filter_count > 0; (*graph)->filter_count--)
66− avfilter_free((*graph)->filters[(*graph)->filter_count - 1]);
65+ for (; (*graph)->nb_filters > 0; (*graph)->nb_filters--)
66+ avfilter_free((*graph)->filters[(*graph)->nb_filters - 1]);
6767 av_freep(&(*graph)->sink_links);
6868 av_freep(&(*graph)->scale_sws_opts);
6969 av_freep(&(*graph)->aresample_swr_opts);
@@ -75,12 +75,12 @@ void avfilter_graph_free(AVFilterGraph **graph) · 5 unmodified lines
7575 int avfilter_graph_add_filter(AVFilterGraph *graph, AVFilterContext *filter)
7676 {
7777 AVFilterContext **filters = av_realloc(graph->filters,
78− sizeof(AVFilterContext*) * (graph->filter_count+1));
78+ sizeof(AVFilterContext*) * (graph->nb_filters + 1));
7979 if (!filters)
8080 return AVERROR(ENOMEM);
8181
8282 graph->filters = filters;
83− graph->filters[graph->filter_count++] = filter;
83+ graph->filters[graph->nb_filters++] = filter;
8484
8585 return 0;
8686 }
@@ -124,7 +124,7 @@ static int graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx) · 37 unmodified lines
124124 AVFilterContext *filt;
125125 int i, j;
126126
127− for (i = 0; i < graph->filter_count; i++) {
127+ for (i = 0; i < graph->nb_filters; i++) {
128128 const AVFilterPad *pad;
129129 filt = graph->filters[i];
130130
@@ -162,7 +162,7 @@ static int graph_config_links(AVFilterGraph *graph, AVClass *log_ctx) · 31 unmodified lines
162162 AVFilterContext *filt;
163163 int i, ret;
164164
165− for (i=0; i < graph->filter_count; i++) {
165+ for (i = 0; i < graph->nb_filters; i++) {
166166 filt = graph->filters[i];
167167
168168 if (!filt->nb_outputs) {
@@ -178,7 +178,7 @@ AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, char *name) · 9 unmodified lines
178178 {
179179 int i;
180180
181− for (i = 0; i < graph->filter_count; i++)
181+ for (i = 0; i < graph->nb_filters; i++)
182182 if (graph->filters[i]->name && !strcmp(name, graph->filters[i]->name))
183183 return graph->filters[i];
184184
@@ -245,7 +245,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 60 unmodified lines
245245
246246 for (j = 0; j < 2; j++) {
247247 /* ask all the sub-filters for their supported media formats */
248− for (i = 0; i < graph->filter_count; i++) {
248+ for (i = 0; i < graph->nb_filters; i++) {
249249 /* Call query_formats on sources first.
250250 This is a temporary workaround for amerge,
251251 until format renegociation is implemented. */
@@ -261,7 +261,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 9 unmodified lines
261261 }
262262
263263 /* go through and merge as many format lists as possible */
264− for (i = 0; i < graph->filter_count; i++) {
264+ for (i = 0; i < graph->nb_filters; i++) {
265265 AVFilterContext *filter = graph->filters[i];
266266
267267 for (j = 0; j < filter->nb_inputs; j++) {
@@ -519,7 +519,7 @@ static void reduce_formats(AVFilterGraph *graph) · 251 unmodified lines
519519 do {
520520 reduced = 0;
521521
522− for (i = 0; i < graph->filter_count; i++)
522+ for (i = 0; i < graph->nb_filters; i++)
523523 reduced |= reduce_formats_on_filter(graph->filters[i]);
524524 } while (reduced);
525525 }
@@ -567,7 +567,7 @@ static void swap_samplerates(AVFilterGraph *graph) · 41 unmodified lines
567567 {
568568 int i;
569569
570− for (i = 0; i < graph->filter_count; i++)
570+ for (i = 0; i < graph->nb_filters; i++)
571571 swap_samplerates_on_filter(graph->filters[i]);
572572 }
573573
@@ -698,7 +698,7 @@ static void swap_channel_layouts(AVFilterGraph *graph) · 124 unmodified lines
698698 {
699699 int i;
700700
701− for (i = 0; i < graph->filter_count; i++)
701+ for (i = 0; i < graph->nb_filters; i++)
702702 swap_channel_layouts_on_filter(graph->filters[i]);
703703 }
704704
@@ -766,7 +766,7 @@ static void swap_sample_fmts(AVFilterGraph *graph) · 61 unmodified lines
766766 {
767767 int i;
768768
769− for (i = 0; i < graph->filter_count; i++)
769+ for (i = 0; i < graph->nb_filters; i++)
770770 swap_sample_fmts_on_filter(graph->filters[i]);
771771
772772 }
@@ -778,7 +778,7 @@ static int pick_formats(AVFilterGraph *graph) · 5 unmodified lines
778778
779779 do{
780780 change = 0;
781− for (i = 0; i < graph->filter_count; i++) {
781+ for (i = 0; i < graph->nb_filters; i++) {
782782 AVFilterContext *filter = graph->filters[i];
783783 if (filter->nb_inputs){
784784 for (j = 0; j < filter->nb_inputs; j++){
@@ -810,7 +810,7 @@ static int pick_formats(AVFilterGraph *graph) · 25 unmodified lines
810810 }
811811 }while(change);
812812
813− for (i = 0; i < graph->filter_count; i++) {
813+ for (i = 0; i < graph->nb_filters; i++) {
814814 AVFilterContext *filter = graph->filters[i];
815815
816816 for (j = 0; j < filter->nb_inputs; j++)
@@ -859,7 +859,7 @@ static int ff_avfilter_graph_config_pointers(AVFilterGraph *graph, · 42 unmodified lines
859859 AVFilterContext *f;
860860 AVFilterLink **sinks;
861861
862− for (i = 0; i < graph->filter_count; i++) {
862+ for (i = 0; i < graph->nb_filters; i++) {
863863 f = graph->filters[i];
864864 for (j = 0; j < f->nb_inputs; j++) {
865865 f->inputs[j]->graph = graph;
@@ -878,7 +878,7 @@ static int ff_avfilter_graph_config_pointers(AVFilterGraph *graph, · 12 unmodified lines
878878 sinks = av_calloc(sink_links_count, sizeof(*sinks));
879879 if (!sinks)
880880 return AVERROR(ENOMEM);
881− for (i = 0; i < graph->filter_count; i++) {
881+ for (i = 0; i < graph->nb_filters; i++) {
882882 f = graph->filters[i];
883883 if (!f->nb_outputs) {
884884 for (j = 0; j < f->nb_inputs; j++) {
@@ -899,7 +899,7 @@ static int graph_insert_fifos(AVFilterGraph *graph, AVClass *log_ctx) · 14 unmodified lines
899899 int i, j, ret;
900900 int fifo_count = 0;
901901
902− for (i = 0; i < graph->filter_count; i++) {
902+ for (i = 0; i < graph->nb_filters; i++) {
903903 f = graph->filters[i];
904904
905905 for (j = 0; j < f->nb_inputs; j++) {
@@ -965,7 +965,7 @@ int avfilter_graph_send_command(AVFilterGraph *graph, const char *target, const · 59 unmodified lines
965965 if(res_len && res)
966966 res[0]= 0;
967967
968− for (i = 0; i < graph->filter_count; i++) {
968+ for (i = 0; i < graph->nb_filters; i++) {
969969 AVFilterContext *filter = graph->filters[i];
970970 if(!strcmp(target, "all") || (filter->name && !strcmp(target, filter->name)) || !strcmp(target, filter->filter->name)){
971971 r = avfilter_process_command(filter, cmd, arg, res, res_len, flags);
@@ -986,7 +986,7 @@ int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const · 14 unmodified lines
986986 if(!graph)
987987 return 0;
988988
989− for (i = 0; i < graph->filter_count; i++) {
989+ for (i = 0; i < graph->nb_filters; i++) {
990990 AVFilterContext *filter = graph->filters[i];
991991 if(filter && (!strcmp(target, "all") || !strcmp(target, filter->name) || !strcmp(target, filter->filter->name))){
992992 AVFilterCommand **queue = &filter->command_queue, *next;

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