summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
authorulion <ulion@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-12-22 08:35:15 +0000
committerulion <ulion@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-12-22 08:35:15 +0000
commitacec444aa5f3cda128a3be6bbc76787467dd3abe (patch)
treec9ca50d1f099b00cb160c658f71393e6da317b5f /command.c
parent3db51117ddb3ac38fbf30a22bdf2d21e871d65c1 (diff)
downloadmpv-acec444aa5f3cda128a3be6bbc76787467dd3abe.tar.bz2
mpv-acec444aa5f3cda128a3be6bbc76787467dd3abe.tar.xz
Check availability before check argument for getting gamma properties.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25493 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'command.c')
-rw-r--r--command.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/command.c b/command.c
index 0e0ea7239f..bb3f198c68 100644
--- a/command.c
+++ b/command.c
@@ -1059,7 +1059,7 @@ static int mp_property_framedropping(m_option_t * prop, int action,
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 * prop, int action, void *arg,
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) *