[MPlayer-dev-eng] [PATCH] fix flickering OSD with tfields, yadif

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Dec 27 13:17:28 CET 2008


Hello,
attached patch adds a new function to do the extra flip necessary for
framerate-doubling filters, it will also redraw the OSD as necessary
and thus get rid of the flickering.
I will apply really soon if there are no objections.

Greetings,
Reimar Döffinger
-------------- next part --------------
diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c
index 37ada3c..d04d7f0 100644
--- a/libmpcodecs/vf.c
+++ b/libmpcodecs/vf.c
@@ -655,6 +655,14 @@ int vf_next_control(struct vf_instance_s* vf, int request, void* data){
     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;
diff --git a/libmpcodecs/vf.h b/libmpcodecs/vf.h
index 27a48ea..a2617ff 100644
--- a/libmpcodecs/vf.h
+++ b/libmpcodecs/vf.h
@@ -112,6 +112,7 @@ int vf_next_config(struct vf_instance_s* vf,
         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);
diff --git a/libmpcodecs/vf_tfields.c b/libmpcodecs/vf_tfields.c
index e70799a..df341ce 100644
--- a/libmpcodecs/vf_tfields.c
+++ b/libmpcodecs/vf_tfields.c
@@ -365,7 +365,7 @@ static int continue_buffered_image(struct vf_instance_s *vf)
 			if (correct_pts)
 				break;
 			else
-				if (!i) vf_next_control(vf, VFCTRL_FLIP_PAGE, NULL);
+				if (!i) vf_extra_flip(vf);
 		}
 		break;
 	case 1:
@@ -395,7 +395,7 @@ static int continue_buffered_image(struct vf_instance_s *vf)
 			if (correct_pts)
 				break;
 			else
-				if (!i) vf_next_control(vf, VFCTRL_FLIP_PAGE, NULL);
+				if (!i) vf_extra_flip(vf);
 		}
 		break;
 	case 2:
@@ -421,7 +421,7 @@ static int continue_buffered_image(struct vf_instance_s *vf)
 			if (correct_pts)
 				break;
 			else
-				if (!i) vf_next_control(vf, VFCTRL_FLIP_PAGE, NULL);
+				if (!i) vf_extra_flip(vf);
 		}
 		break;
 	}
diff --git a/libmpcodecs/vf_yadif.c b/libmpcodecs/vf_yadif.c
index 971ad98..a8328d3 100644
--- a/libmpcodecs/vf_yadif.c
+++ b/libmpcodecs/vf_yadif.c
@@ -440,7 +440,7 @@ static int continue_buffered_image(struct vf_instance_s *vf)
         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;


More information about the MPlayer-dev-eng mailing list