summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-rw-r--r--video/filter/vf.c7
-rw-r--r--video/filter/vf.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/video/filter/vf.c b/video/filter/vf.c
index 274ca945a2..b632314426 100644
--- a/video/filter/vf.c
+++ b/video/filter/vf.c
@@ -458,6 +458,13 @@ struct mp_image *vf_read_output_frame(struct vf_chain *c)
return vf_dequeue_output_frame(c->last);
}
+// Undo the previous vf_read_output_frame().
+void vf_unread_output_frame(struct vf_chain *c, struct mp_image *img)
+{
+ struct vf_instance *vf = c->last;
+ MP_TARRAY_INSERT_AT(vf, vf->out_queued, vf->num_out_queued, 0, img);
+}
+
// Some filters (vf_vapoursynth) filter on separate threads, and may need new
// input from the decoder, even though the core does not need a new output image
// yet (this is required to get proper pipelining in the filter). If the filter
diff --git a/video/filter/vf.h b/video/filter/vf.h
index 49296fb9b2..901ccead95 100644
--- a/video/filter/vf.h
+++ b/video/filter/vf.h
@@ -157,6 +157,7 @@ int vf_filter_frame(struct vf_chain *c, struct mp_image *img);
int vf_output_frame(struct vf_chain *c, bool eof);
int vf_needs_input(struct vf_chain *c);
struct mp_image *vf_read_output_frame(struct vf_chain *c);
+void vf_unread_output_frame(struct vf_chain *c, struct mp_image *img);
void vf_seek_reset(struct vf_chain *c);
struct vf_instance *vf_append_filter(struct vf_chain *c, const char *name,
char **args);