]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/sink_buffer.c
Merge commit '44a0036d10579ed91e48df24859e54b08a582742'
[ffmpeg] / libavfilter / sink_buffer.c
index 88fefba0d9cd6e301e04a8c8fedfcf921ee79200..a34cb24d2138bee5452fbc14fba25ebfc29f7ee8 100644 (file)
@@ -117,16 +117,14 @@ static int add_buffer_ref(AVFilterContext *ctx, AVFilterBufferRef *ref)
     return 0;
 }
 
-static int end_frame(AVFilterLink *inlink)
+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *ref)
 {
     AVFilterContext *ctx = inlink->dst;
     BufferSinkContext *buf = inlink->dst->priv;
     int ret;
 
-    av_assert1(inlink->cur_buf);
-    if ((ret = add_buffer_ref(ctx, inlink->cur_buf)) < 0)
+    if ((ret = add_buffer_ref(ctx, ref)) < 0)
         return ret;
-    inlink->cur_buf = NULL;
     if (buf->warning_limit &&
         av_fifo_size(buf->fifo) / sizeof(AVFilterBufferRef *) >= buf->warning_limit) {
         av_log(ctx, AV_LOG_WARNING,
@@ -238,7 +236,7 @@ static const AVFilterPad ffbuffersink_inputs[] = {
     {
         .name      = "default",
         .type      = AVMEDIA_TYPE_VIDEO,
-        .end_frame = end_frame,
+        .filter_frame = filter_frame,
         .min_perms = AV_PERM_READ | AV_PERM_PRESERVE,
     },
     { NULL },
@@ -260,7 +258,7 @@ static const AVFilterPad buffersink_inputs[] = {
     {
         .name      = "default",
         .type      = AVMEDIA_TYPE_VIDEO,
-        .end_frame = end_frame,
+        .filter_frame = filter_frame,
         .min_perms = AV_PERM_READ | AV_PERM_PRESERVE,
     },
     { NULL },
@@ -278,12 +276,6 @@ AVFilter avfilter_vsink_buffersink = {
     .outputs       = NULL,
 };
 
-static int filter_frame(AVFilterLink *link, AVFilterBufferRef *samplesref)
-{
-    end_frame(link);
-    return 0;
-}
-
 static av_cold int asink_init(AVFilterContext *ctx, const char *args, void *opaque)
 {
     BufferSinkContext *buf = ctx->priv;