Fix bug, get master volume correctly 10/109010/1 accepted/tizen/3.0/mobile/20170109.003330 submit/tizen_3.0/20170106.062231
authorJeongho Mok <jho.mok@samsung.com>
Fri, 6 Jan 2017 12:02:05 +0000 (21:02 +0900)
committerJeongho Mok <jho.mok@samsung.com>
Fri, 6 Jan 2017 12:02:05 +0000 (21:02 +0900)
[Version] 0.1.22
[Profile] Common
[Issue Type] Code Enhancement

Change-Id: I2f8b87aad7dcbace0b04d86e09bde4c28b843d48

packaging/audio-hal-sc7727.spec
tizen-audio-volume.c

index 24f038c..74ff5d2 100644 (file)
@@ -1,6 +1,6 @@
 Name:       audio-hal-sc7727
 Summary:    TIZEN Audio HAL for SC7727
-Version:    0.1.21
+Version:    0.1.22
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index fa96693..a9c427a 100644 (file)
@@ -460,11 +460,6 @@ audio_return_t audio_get_volume_level_max(void *audio_handle, audio_volume_info_
     AUDIO_RETURN_VAL_IF_FAIL(info, AUDIO_ERR_PARAMETER);
     AUDIO_RETURN_VAL_IF_FAIL(level, AUDIO_ERR_PARAMETER);
 
-    if (!strncmp(info->type, "master", strlen("master"))) {
-        *level = g_master_volume_level;
-        return AUDIO_RET_OK;
-    }
-
     /* Get max volume level by device & type */
     *level = ah->volume.volume_level_max[__get_volume_idx_by_string_type(info->type)];
 
@@ -481,6 +476,11 @@ audio_return_t audio_get_volume_level(void *audio_handle, audio_volume_info_t *i
     AUDIO_RETURN_VAL_IF_FAIL(info, AUDIO_ERR_PARAMETER);
     AUDIO_RETURN_VAL_IF_FAIL(level, AUDIO_ERR_PARAMETER);
 
+    if (!strncmp(info->type, "master", strlen("master"))) {
+        *level = g_master_volume_level;
+        return AUDIO_RET_OK;
+    }
+
     *level = ah->volume.volume_level[__get_volume_idx_by_string_type(info->type)];
 
     AUDIO_LOG_INFO("get [%s] volume_level: %d, direction(%d)", info->type, *level, info->direction);