[Mplayer-cvslog] CVS: main mplayer.c,1.530,1.531

Alex Beregszaszi alex at mplayerhq.hu
Thu Jul 25 15:12:26 CEST 2002


Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv29903

Modified Files:
	mplayer.c 
Log Message:
eq reworked

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.530
retrieving revision 1.531
diff -u -r1.530 -r1.531
--- mplayer.c	25 Jul 2002 03:37:27 -0000	1.530
+++ mplayer.c	25 Jul 2002 13:12:23 -0000	1.531
@@ -270,10 +270,10 @@
 
 char* current_module=NULL; // for debugging
 
-int vo_gamma_brightness = 0;
-int vo_gamma_contrast = 0;
-int vo_gamma_saturation = 0;
-int vo_gamma_hue = 0;
+int vo_gamma_brightness = 1000;
+int vo_gamma_contrast = 1000;
+int vo_gamma_saturation = 1000;
+int vo_gamma_hue = 1000;
 
 // ---
 
@@ -1331,11 +1331,17 @@
 // ========== Init display (sh_video->disp_w*sh_video->disp_h/out_fmt) ============
 
 current_module="init_vo";
-    /* set defaults */
-    set_video_colors(sh_video, "brightness", vo_gamma_brightness);
-    set_video_colors(sh_video, "contrast", vo_gamma_contrast);
-    set_video_colors(sh_video, "saturation", vo_gamma_saturation);
-    set_video_colors(sh_video, "hue", vo_gamma_hue);
+    if (sh_video)
+    {
+	if (vo_gamma_brightness != 1000)
+	    set_video_colors(sh_video, "brightness", vo_gamma_brightness);
+	if (vo_gamma_contrast != 1000)
+	    set_video_colors(sh_video, "contrast", vo_gamma_contrast);
+	if (vo_gamma_saturation != 1000)
+	    set_video_colors(sh_video, "saturation", vo_gamma_saturation);
+	if (vo_gamma_hue != 1000)
+	    set_video_colors(sh_video, "hue", vo_gamma_hue);
+    }
 
    if(vo_flags & 0x08 && vo_spudec)
       spudec_set_hw_spu(vo_spudec,video_out);
@@ -2392,7 +2398,16 @@
     } break;
     case MP_CMD_BRIGHTNESS :  {
       int v = cmd->args[0].v.i, abs = cmd->args[1].v.i;
-     
+      
+      if (!sh_video)
+	break;
+      
+      if (vo_gamma_brightness == 1000)
+      {
+	vo_gamma_brightness = 0;
+	get_video_colors(sh_video, "brightness", &vo_gamma_brightness);
+      }
+
       if (abs)
         vo_gamma_brightness = v;
       else
@@ -2415,6 +2430,15 @@
     } break;
     case MP_CMD_CONTRAST :  {
       int v = cmd->args[0].v.i, abs = cmd->args[1].v.i;
+
+      if (!sh_video)
+	break;
+      
+      if (vo_gamma_contrast == 1000)
+      {
+	vo_gamma_contrast = 0;
+	get_video_colors(sh_video, "contrast", &vo_gamma_contrast);
+      }
      
       if (abs)
         vo_gamma_contrast = v;
@@ -2438,7 +2462,16 @@
     } break;
     case MP_CMD_SATURATION :  {
       int v = cmd->args[0].v.i, abs = cmd->args[1].v.i;
-     
+
+      if (!sh_video)
+	break;
+      
+      if (vo_gamma_saturation == 1000)
+      {
+	vo_gamma_saturation = 0;
+	get_video_colors(sh_video, "saturation", &vo_gamma_saturation);
+      }
+
       if (abs)
         vo_gamma_saturation = v;
       else
@@ -2461,6 +2494,15 @@
     } break;
     case MP_CMD_HUE :  {
       int v = cmd->args[0].v.i, abs = cmd->args[1].v.i;
+
+      if (!sh_video)
+	break;
+      
+      if (vo_gamma_hue == 1000)
+      {
+	vo_gamma_hue = 0;
+	get_video_colors(sh_video, "hue", &vo_gamma_hue);
+      }
      
       if (abs)
         vo_gamma_hue = v;




More information about the MPlayer-cvslog mailing list