summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2019-02-06 16:21:08 +0000
committerDylan Baker <[email protected]>2019-02-07 09:37:07 -0800
commit262fd16b993de6a0248da0d69f14fefa732753d3 (patch)
tree71274741ec7465375f9aa13c498c47398d4c3e7a
parent452f9b9984d67ccac15b9532dd7f73493611824f (diff)
xvmc: fix string comparison
Fixes: c7b65dcaffeb9d0760c8 "xvmc: Define some Xv attribs to allow users to specify color standard and procamp" Cc: Christian König <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> (cherry picked from commit 110a6e1839bcf31e3592389ad55a7ba07b551965)
-rw-r--r--src/gallium/state_trackers/xvmc/attributes.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gallium/state_trackers/xvmc/attributes.c b/src/gallium/state_trackers/xvmc/attributes.c
index 375705669b0..6e4d78a9a29 100644
--- a/src/gallium/state_trackers/xvmc/attributes.c
+++ b/src/gallium/state_trackers/xvmc/attributes.c
@@ -90,15 +90,15 @@ Status XvMCSetAttribute(Display *dpy, XvMCContext *context, Atom attribute, int
if (!attr)
return XvMCBadContext;
- if (strcmp(attr, XV_BRIGHTNESS))
+ if (strcmp(attr, XV_BRIGHTNESS) == 0)
context_priv->procamp.brightness = value / 1000.0f;
- else if (strcmp(attr, XV_CONTRAST))
+ else if (strcmp(attr, XV_CONTRAST) == 0)
context_priv->procamp.contrast = value / 1000.0f + 1.0f;
- else if (strcmp(attr, XV_SATURATION))
+ else if (strcmp(attr, XV_SATURATION) == 0)
context_priv->procamp.saturation = value / 1000.0f + 1.0f;
- else if (strcmp(attr, XV_HUE))
+ else if (strcmp(attr, XV_HUE) == 0)
context_priv->procamp.hue = value / 1000.0f;
- else if (strcmp(attr, XV_COLORSPACE))
+ else if (strcmp(attr, XV_COLORSPACE) == 0)
context_priv->color_standard = value ?
VL_CSC_COLOR_STANDARD_BT_601 :
VL_CSC_COLOR_STANDARD_BT_709;
@@ -134,15 +134,15 @@ Status XvMCGetAttribute(Display *dpy, XvMCContext *context, Atom attribute, int
if (!attr)
return XvMCBadContext;
- if (strcmp(attr, XV_BRIGHTNESS))
+ if (strcmp(attr, XV_BRIGHTNESS) == 0)
*value = context_priv->procamp.brightness * 1000;
- else if (strcmp(attr, XV_CONTRAST))
+ else if (strcmp(attr, XV_CONTRAST) == 0)
*value = context_priv->procamp.contrast * 1000 - 1000;
- else if (strcmp(attr, XV_SATURATION))
+ else if (strcmp(attr, XV_SATURATION) == 0)
*value = context_priv->procamp.saturation * 1000 + 1000;
- else if (strcmp(attr, XV_HUE))
+ else if (strcmp(attr, XV_HUE) == 0)
*value = context_priv->procamp.hue * 1000;
- else if (strcmp(attr, XV_COLORSPACE))
+ else if (strcmp(attr, XV_COLORSPACE) == 0)
*value = context_priv->color_standard == VL_CSC_COLOR_STANDARD_BT_709;
else
return BadName;