History

lavfi: add a function for counting elements in AVFilterPad arrays.

The caller needs to know what valid indices can be passed to avfilter_pad_get_name/type.

Anton Khirnov committed 13 years ago

Commit 7e8fe4b1 parent 7cdd7373 files · +10 −3Browse files

Showing the changes to libavfilter/avfilter.c (1 of 3 files). Show all

Unified · Split

libavfilter/avfilter.c+3−3
@@ -304,7 +304,7 @@ void avfilter_uninit(void) · 303 unmodified lines
304304 next_registered_avfilter_idx = 0;
305305 }
306306
307−static int pad_count(const AVFilterPad *pads)
307+int avfilter_pad_count(const AVFilterPad *pads)
308308 {
309309 int count;
310310
@@ -377,7 +377,7 @@ AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name) · 66 unmodified lines
377377 av_opt_set_defaults(ret->priv);
378378 }
379379
380− ret->nb_inputs = pad_count(filter->inputs);
380+ ret->nb_inputs = avfilter_pad_count(filter->inputs);
381381 if (ret->nb_inputs ) {
382382 ret->input_pads = av_malloc(sizeof(AVFilterPad) * ret->nb_inputs);
383383 if (!ret->input_pads)
@@ -388,7 +388,7 @@ AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name) · 4 unmodified lines
388388 goto err;
389389 }
390390
391− ret->nb_outputs = pad_count(filter->outputs);
391+ ret->nb_outputs = avfilter_pad_count(filter->outputs);
392392 if (ret->nb_outputs) {
393393 ret->output_pads = av_malloc(sizeof(AVFilterPad) * ret->nb_outputs);
394394 if (!ret->output_pads)

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