more mp_property_deinterlace simplification, patch by
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sat, 18 Nov 2006 12:38:03 +0000 (12:38 +0000)
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sat, 18 Nov 2006 12:38:03 +0000 (12:38 +0000)
Carl Eugen Hoyos [cehoyos -at- rainbow studorg tuwien ac at]

git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@21018 b3059339-0415-0410-9bf9-f77b7e298cf2

libvo/vo_xvmc.c
mplayer.c

index a9cc988..735cd0f 100644 (file)
@@ -1383,10 +1383,7 @@ static int control(uint32_t request, void *data, ... )
         *(int*)data = bob_deinterlace;
         return VO_TRUE;
       case VOCTRL_SET_DEINTERLACE:
-        if (*(int*)data == -1)
-            bob_deinterlace = !bob_deinterlace;
-        else
-            bob_deinterlace = *(int*)data;
+        bob_deinterlace = *(int*)data;
         return VO_TRUE;
       case VOCTRL_QUERY_FORMAT:
          return query_format(*((uint32_t*)data));
index d56bf8c..6386190 100644 (file)
--- a/mplayer.c
+++ b/mplayer.c
@@ -1934,7 +1934,7 @@ static int mp_property_fullscreen(m_option_t* prop,int action,void* arg) {
 }
 
 static int mp_property_deinterlace(m_option_t* prop,int action,void* arg) {
-    int toggle = -1;
+    int deinterlace;
     vf_instance_t *vf;
     if (!sh_video || !sh_video->vfilter) return M_PROPERTY_UNAVAILABLE;
     vf = sh_video->vfilter;
@@ -1950,7 +1950,9 @@ static int mp_property_deinterlace(m_option_t* prop,int action,void* arg) {
         return M_PROPERTY_OK;
     case M_PROPERTY_STEP_UP:
     case M_PROPERTY_STEP_DOWN:
-        vf->control(vf, VFCTRL_SET_DEINTERLACE, &toggle);
+        vf->control(vf, VFCTRL_GET_DEINTERLACE, &deinterlace);
+        deinterlace = !deinterlace;
+        vf->control(vf, VFCTRL_SET_DEINTERLACE, &deinterlace);
         return M_PROPERTY_OK;
     }
     return M_PROPERTY_NOT_IMPLEMENTED;