[MPlayer-dev-eng] De- and reactivate yadif

Carl Eugen Hoyos cehoyos at rainbow.studorg.tuwien.ac.at
Fri Nov 17 19:38:22 CET 2006


Attached patch allows to de- and reactivate yadif.
I think it's very useful, although mplayer has to be started with -vf 
yadif to make the patch work.

Greetings, Carl Eugen

-------------- next part --------------
Index: libmpcodecs/vf_yadif.c
===================================================================
--- libmpcodecs/vf_yadif.c      (Revision 20990)
+++ libmpcodecs/vf_yadif.c      (Arbeitskopie)
@@ -391,10 +391,13 @@

 static int continue_buffered_image(struct vf_instance_s *vf);
 extern int correct_pts;
+static int do_deinterlace=1;

 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
     int tff;

+    if (!do_deinterlace) return vf_next_put_image(vf, mpi, pts);
+
     if(vf->priv->parity < 0) {
         if (mpi->fields & MP_IMGFIELD_ORDERED)
             tff = !!(mpi->fields & MP_IMGFIELD_TOP_FIRST);
@@ -469,6 +472,21 @@
     return 0;
 }

+static int control(struct vf_instance_s* vf, int request, void* data){
+    switch (request){
+      case VFCTRL_GET_DEINTERLACE:
+        *(int*)data = do_deinterlace;
+        return CONTROL_OK;
+      case VFCTRL_SET_DEINTERLACE:
+        if (*(int*)data == -1)
+            do_deinterlace = !do_deinterlace;
+        else
+            do_deinterlace = *(int*)data;
+        return CONTROL_OK;
+    }
+    return CONTROL_NA;
+}
+
 static int open(vf_instance_t *vf, char* args){

     vf->config=config;
@@ -476,6 +494,7 @@
     vf->query_format=query_format;
     vf->uninit=uninit;
     vf->priv=malloc(sizeof(struct vf_priv_s));
+    vf->control=control;
     memset(vf->priv, 0, sizeof(struct vf_priv_s));

     vf->priv->mode=0;



More information about the MPlayer-dev-eng mailing list