changeset 28174:245a232deb93

Avoid flickering OSD with -vf yadif=1
author reimar
date Tue, 30 Dec 2008 10:38:29 +0000
parents cb4a6bcebe0a
children 60402016152c
files libmpcodecs/vf.c libmpcodecs/vf.h libmpcodecs/vf_yadif.c
diffstat 3 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf.c	Mon Dec 29 19:09:45 2008 +0000
+++ b/libmpcodecs/vf.c	Tue Dec 30 10:38:29 2008 +0000
@@ -655,6 +655,14 @@
     return vf->next->control(vf->next,request,data);
 }
 
+void vf_extra_flip(struct vf_instance_s* vf) {
+    vf_next_control(vf, VFCTRL_DRAW_OSD, NULL);
+#ifdef CONFIG_ASS
+    vf_next_control(vf, VFCTRL_DRAW_EOSD, NULL);
+#endif
+    vf_next_control(vf, VFCTRL_FLIP_PAGE, NULL);
+}
+
 int vf_next_query_format(struct vf_instance_s* vf, unsigned int fmt){
     int flags=vf->next->query_format(vf->next,fmt);
     if(flags) flags|=vf->default_caps;
--- a/libmpcodecs/vf.h	Mon Dec 29 19:09:45 2008 +0000
+++ b/libmpcodecs/vf.h	Tue Dec 30 10:38:29 2008 +0000
@@ -112,6 +112,7 @@
         int width, int height, int d_width, int d_height,
 	unsigned int flags, unsigned int outfmt);
 int vf_next_control(struct vf_instance_s* vf, int request, void* data);
+void vf_extra_flip(struct vf_instance_s* vf);
 int vf_next_query_format(struct vf_instance_s* vf, unsigned int fmt);
 int vf_next_put_image(struct vf_instance_s* vf,mp_image_t *mpi, double pts);
 void vf_next_draw_slice (struct vf_instance_s* vf, unsigned char** src, int* stride, int w,int h, int x, int y);
--- a/libmpcodecs/vf_yadif.c	Mon Dec 29 19:09:45 2008 +0000
+++ b/libmpcodecs/vf_yadif.c	Tue Dec 30 10:38:29 2008 +0000
@@ -440,7 +440,7 @@
         if (correct_pts)
             break;
         if(i<(vf->priv->mode&1))
-            vf_next_control(vf, VFCTRL_FLIP_PAGE, NULL);
+            vf_extra_flip(vf);
     }
     vf->priv->buffered_i = 1;
     return ret;