summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf.c
diff options
context:
space:
mode:
authoruau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-07-06 06:58:17 +0000
committeruau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-07-06 06:58:17 +0000
commite2727ec797e19fb6d4d2d3338ce17dce976e0b28 (patch)
treed66f39217166121fab9751c1b271eb0734f68999 /libmpcodecs/vf.c
parent11ade8f86d0d358e90737451983ed37075832e5e (diff)
downloadmpv-e2727ec797e19fb6d4d2d3338ce17dce976e0b28.tar.bz2
mpv-e2727ec797e19fb6d4d2d3338ce17dce976e0b28.tar.xz
Add a new video pts tracking mode, enabled by option -correct-pts.
This mode has the following differences: - Video timing is correct for streams with B frames, at least with some demuxers. - Video filters can modify frame timestamps and insert new frames, and removing frames is handled better than before. - Some things are known to break, it's not usable as the default yet. Things should work as before when the -correct-pts option is not used. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18922 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vf.c')
-rw-r--r--libmpcodecs/vf.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c
index 0b7014d17d..29fb5a2b55 100644
--- a/libmpcodecs/vf.c
+++ b/libmpcodecs/vf.c
@@ -558,6 +558,38 @@ void vf_clone_mpi_attributes(mp_image_t* dst, mp_image_t* src){
dst->qscale= src->qscale;
}
}
+
+void vf_queue_frame(vf_instance_t *vf, int (*func)(vf_instance_t *))
+{
+ vf->continue_buffered_image = func;
+}
+
+// Output the next buffered image (if any) from the filter chain.
+// The queue could be kept as a simple stack/list instead avoiding the
+// looping here, but there's currently no good context variable where
+// that could be stored so this was easier to implement.
+
+int vf_output_queued_frame(vf_instance_t *vf)
+{
+ while (1) {
+ int ret;
+ vf_instance_t *current;
+ vf_instance_t *last=NULL;
+ int (*tmp)(vf_instance_t *);
+ for (current = vf; current; current = current->next)
+ if (current->continue_buffered_image)
+ last = current;
+ if (!last)
+ return 0;
+ tmp = last->continue_buffered_image;
+ last->continue_buffered_image = NULL;
+ ret = tmp(last);
+ if (ret)
+ return ret;
+ }
+}
+
+
/**
* \brief Video config() function wrapper
*