From 2c1535e6f96bbaeceeb45b145930b2a10419c190 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Mon, 23 Oct 2017 18:19:48 -0700 Subject: binding: mediaplayer: fix index/volume selection First track or volume of 0% couldn't ever be selected due to a invalid logic condition Bug-AGL: SPEC-931 Change-Id: I6bc7d9026eac24eef66ab1ec13b1a8766da7d586 Signed-off-by: Matt Ranostay --- binding/afm-mediaplayer-binding.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'binding') diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c index 3aab371..6c3c3b3 100644 --- a/binding/afm-mediaplayer-binding.c +++ b/binding/afm-mediaplayer-binding.c @@ -339,7 +339,7 @@ static void controls(struct afb_req request) long int idx = strtol(parameter, NULL, 10); GList *list = NULL; - if (idx == 0 && !errno) { + if (idx == 0 && errno) { afb_req_fail(request, "failed", "invalid index"); pthread_mutex_unlock(&mutex); return; @@ -362,7 +362,7 @@ static void controls(struct afb_req request) const char *parameter = afb_req_value(request, "volume"); long int volume = strtol(parameter, NULL, 10); - if (volume == 0 && !errno) { + if (volume == 0 && errno) { afb_req_fail(request, "failed", "invalid volume"); pthread_mutex_unlock(&mutex); return; -- cgit 1.2.3-korg