[0.2.105] set pitch value if it is enabled 90/201990/1
authorEunhye Choi <eunhae1.choi@samsung.com>
Thu, 21 Mar 2019 12:52:25 +0000 (21:52 +0900)
committerEunhye Choi <eunhae1.choi@samsung.com>
Thu, 21 Mar 2019 12:52:25 +0000 (21:52 +0900)
Change-Id: I7d75d48cc6dd9590cbebf3e5fe60c6c91d93ba2d

legacy/src/legacy_player.c
packaging/mmsvc-player.spec

index 56bc119..61b6aba 100644 (file)
@@ -3006,6 +3006,8 @@ int legacy_player_pitch_set_value(player_h player, float pitch)
 {
        player_s *handle = (player_s *)player;
        int ret = MM_ERROR_NONE;
+       int is_enabled = 0;
+
        PLAYER_INSTANCE_CHECK(player);
 
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
@@ -3013,6 +3015,15 @@ int legacy_player_pitch_set_value(player_h player, float pitch)
                return PLAYER_ERROR_INVALID_STATE;
        }
 
+       ret = mm_player_get_attribute(handle->mm_handle, NULL, MM_PLAYER_PITCH_CONTROL, &is_enabled, (char *)NULL);
+       if (ret != MM_ERROR_NONE)
+               return __player_convert_error_code(ret, (char *)__FUNCTION__);
+
+       if (!is_enabled) {
+               LOGE("pitch is not enabled");
+               return PLAYER_ERROR_INVALID_OPERATION;
+       }
+
        LOGD("set pitch value %1.3f", pitch);
        ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_PITCH_VALUE, (double)pitch, (char *)NULL);
        if (ret != MM_ERROR_NONE)
index 2a1d28f..90cdfaf 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-player
 Summary:    A Media Player module for muse server
-Version:    0.2.104
+Version:    0.2.105
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0