diff options
author | wm4 <wm4@nowhere> | 2014-04-28 19:44:35 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-04-28 22:23:31 +0200 |
commit | 42f65ce1083ca38605a8c775ee339cf0cc669cb8 (patch) | |
tree | f10e5c7b5e8646eb8b8c507f09866a76b68fd9d1 /video/filter/vf.h | |
parent | a6dafb061fb4be0f02070acd92f8c6a0fde31823 (diff) | |
download | mpv-42f65ce1083ca38605a8c775ee339cf0cc669cb8.tar.bz2 mpv-42f65ce1083ca38605a8c775ee339cf0cc669cb8.tar.xz |
video: don't drop last frame when deinterlacing with yadif
Or in other words, add support for properly draining remaining frames
from video filters. vf_yadif is buffering at least one frame, and the
buffered frame was not retrieved on EOF.
For most filters, ignore this for now, and just adjust them to the
changed semantics of filter_ext. But for vf_lavfi (used by vf_yadif),
real support is implemented. libavfilter handles this simply by passing
a NULL frame to av_buffersrc_add_frame(), so we just have to make
mp_to_av() handle NULL arguments.
In load_next_vo_frame(), we first try to output a frame buffered in the
VO, then the filter, and then (if EOF is reached and there's still no
new frame) the VO again, with draining enabled. I guess this was
implemented slightly incorrectly before, because the filter chain still
could have had remaining output frames.
Diffstat (limited to 'video/filter/vf.h')
-rw-r--r-- | video/filter/vf.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/video/filter/vf.h b/video/filter/vf.h index d11c6de575..8e73c69256 100644 --- a/video/filter/vf.h +++ b/video/filter/vf.h @@ -70,6 +70,9 @@ typedef struct vf_instance { // Like filter(), but can return an error code ( >= 0 means success). This // callback is also more practical when the filter can return multiple // output images. Use vf_add_output_frame() to queue output frames. + // Warning: this is called with mpi==NULL if there is no more input at + // all (i.e. the video has reached end of file condition). This + // can be used to output delayed or otherwise remaining images. int (*filter_ext)(struct vf_instance *vf, struct mp_image *mpi); void (*uninit)(struct vf_instance *vf); @@ -133,7 +136,7 @@ int vf_reconfig(struct vf_chain *c, const struct mp_image_params *params); int vf_control_any(struct vf_chain *c, int cmd, void *arg); int vf_control_by_label(struct vf_chain *c, int cmd, void *arg, bstr label); int vf_filter_frame(struct vf_chain *c, struct mp_image *img); -struct mp_image *vf_output_queued_frame(struct vf_chain *c); +struct mp_image *vf_output_queued_frame(struct vf_chain *c, bool eof); void vf_seek_reset(struct vf_chain *c); struct vf_instance *vf_append_filter(struct vf_chain *c, const char *name, char **args); |