diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 27d163f79a..93e866b79c 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -1458,6 +1458,11 @@ int ff_inlink_check_available_frame(AVFilterLink *link) return ff_framequeue_queued_frames(&link->fifo) > 0; } +int ff_inlink_queued_samples(AVFilterLink *link) +{ + return ff_framequeue_queued_samples(&link->fifo); +} + int ff_inlink_check_available_samples(AVFilterLink *link, unsigned min) { uint64_t samples = ff_framequeue_queued_samples(&link->fifo); diff --git a/libavfilter/filters.h b/libavfilter/filters.h index ff900da63f..1157755403 100644 --- a/libavfilter/filters.h +++ b/libavfilter/filters.h @@ -72,6 +72,13 @@ size_t ff_inlink_queued_frames(AVFilterLink *link); */ int ff_inlink_check_available_frame(AVFilterLink *link); + +/*** + * Get the number of samples available on the link. + * @return the numer of samples available on the link. + */ +int ff_inlink_queued_samples(AVFilterLink *link); + /** * Test if enough samples are available on the link. * @return >0 if enough samples are available