[MPlayer-cvslog] r25493 - trunk/command.c

ulion subversion at mplayerhq.hu
Sat Dec 22 09:35:16 CET 2007


Author: ulion
Date: Sat Dec 22 09:35:15 2007
New Revision: 25493

Log:
Check availability before check argument for getting gamma properties.


Modified:
   trunk/command.c

Modified: trunk/command.c
==============================================================================
--- trunk/command.c	(original)
+++ trunk/command.c	Sat Dec 22 09:35:15 2007
@@ -1059,7 +1059,7 @@ static int mp_property_framedropping(m_o
 static int mp_property_gamma(m_option_t * prop, int action, void *arg,
 			     MPContext * mpctx)
 {
-    int *gamma = prop->priv, r;
+    int *gamma = prop->priv, r, val;
 
     if (!mpctx->sh_video)
 	return M_PROPERTY_UNAVAILABLE;
@@ -1080,12 +1080,13 @@ static int mp_property_gamma(m_option_t 
 	    break;
 	return r;
     case M_PROPERTY_GET:
-	if (!arg)
-	    return M_PROPERTY_ERROR;
-	r = get_video_colors(mpctx->sh_video, prop->name, arg);
-	if (r <= 0)
-	    break;
-	return r;
+	if (get_video_colors(mpctx->sh_video, prop->name, &val) > 0) {
+	    if (!arg)
+		return M_PROPERTY_ERROR;
+	    *(int *)arg = val;
+	    return M_PROPERTY_OK;
+	}
+	break;
     case M_PROPERTY_STEP_UP:
     case M_PROPERTY_STEP_DOWN:
 	*gamma += (arg ? *(int *) arg : 1) *



More information about the MPlayer-cvslog mailing list