diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2017-10-23 18:19:48 -0700 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2017-10-23 18:58:46 -0700 |
commit | 2c1535e6f96bbaeceeb45b145930b2a10419c190 (patch) | |
tree | cac6eedbaf78650f7c4577a935837af0b0a5d5dd /binding | |
parent | 9d5f34e17c41332cddab11b71e15f28393f593c1 (diff) |
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 <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding')
-rw-r--r-- | binding/afm-mediaplayer-binding.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |