diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-15 07:32:05 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-20 13:19:59 +0200 |
commit | 7c5f998196d101a661d802aa48dd62dd93d1fb3d (patch) | |
tree | 21ce867a770061faab5cfb9ea82321611e813676 /libavfilter/avfilter.c | |
parent | 8be701d9f7f77ff2282cc7fe6e0791ca5419de70 (diff) | |
download | ffmpeg-7c5f998196d101a661d802aa48dd62dd93d1fb3d.tar.gz |
avfilter/avfilter: Add avfilter_filter_pad_count()
It is intended as replacement for avfilter_pad_count(). In contrast to
the latter, it avoids a loop.
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r-- | libavfilter/avfilter.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index a869a76b71..b5f5616fde 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -556,6 +556,11 @@ int avfilter_pad_count(const AVFilterPad *pads) av_assert0(!"AVFilterPad list not from a filter"); } +unsigned avfilter_filter_pad_count(const AVFilter *filter, int is_output) +{ + return is_output ? filter->nb_outputs : filter->nb_inputs; +} + static const char *default_filter_name(void *filter_ctx) { AVFilterContext *ctx = filter_ctx; |