@@ -125,6 +125,11 @@ int attribute_align_arg av_buffersink_get_samples(AVFilterContext *ctx,
return get_frame_internal(ctx, frame, 0, nb_samples);
}
+int64_t av_buffersink_get_pts(AVFilterContext *ctx)
+{
+ return ctx->inputs[0]->current_pts;
+}
+
#if FF_API_NEXT
AVBufferSinkParams *av_buffersink_params_alloc(void)
{
@@ -59,6 +59,11 @@ int av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flag
*/
#define AV_BUFFERSINK_FLAG_NO_REQUEST 2
+/**
+ * Get the current PTS, i.e. the PTS of the last frame or the end of stream.
+ */
+int64_t av_buffersink_get_pts(AVFilterContext *ctx);
+
#if FF_API_NEXT
/**
* Struct to use for initializing a buffersink context.
TODO APIChange & bump Signed-off-by: Nicolas George <george@nsup.org> --- libavfilter/buffersink.c | 5 +++++ libavfilter/buffersink.h | 5 +++++ 2 files changed, 10 insertions(+)