Fix to return valid error type 41/237141/3
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 25 Jun 2020 08:41:55 +0000 (17:41 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 25 Jun 2020 12:27:07 +0000 (21:27 +0900)
Codes returning mm-common error type are fixed.

[Version] 0.6.13
[Issue Type] Bug fix

Change-Id: Ie78b573617f46cfbeefb5bf6cdc3aa08979a8872
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-sound-manager.spec
src/sound_manager.c
src/sound_manager_internal.c

index c13d102c7f931fa3f3ce50e8112207ec6d1cdbc8..9c5708ca1429194b4c00d6cf46b2640a62bb9cb6 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-sound-manager
 Summary:    Sound Manager library
-Version:    0.6.12
+Version:    0.6.13
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 0d28bbf8a15f2f0da36cefecd5042401339dca6c..d1af4571273c3373218047c97c54b5dfecb7f13c 100644 (file)
@@ -190,7 +190,7 @@ int sound_manager_destroy_stream_information(sound_stream_info_h stream_info)
        }
        SM_LEAVE_CRITICAL_SECTION(&stream_h->vstream_mutex);
 
-       SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_state_mutex, MM_ERROR_SOUND_INTERNAL);
+       SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_state_mutex, SOUND_MANAGER_ERROR_INTERNAL);
        ret = _destroy_pa_connection_and_unregister_focus(stream_h);
        SM_LEAVE_CRITICAL_SECTION(&stream_h->focus_state_mutex);
        if (ret == SOUND_MANAGER_ERROR_NONE)
@@ -333,8 +333,8 @@ int sound_manager_acquire_focus(sound_stream_info_h stream_info, sound_stream_fo
        }
 
        if (!is_focus_cb_thread) {
-               SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_cb_mutex, MM_ERROR_SOUND_INTERNAL);
-               SM_ENTER_CRITICAL_SECTION_WITH_UNLOCK_AND_RETURN(&stream_h->focus_state_mutex, &stream_h->focus_cb_mutex, MM_ERROR_SOUND_INTERNAL);
+               SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_cb_mutex, SOUND_MANAGER_ERROR_INTERNAL);
+               SM_ENTER_CRITICAL_SECTION_WITH_UNLOCK_AND_RETURN(&stream_h->focus_state_mutex, &stream_h->focus_cb_mutex, SOUND_MANAGER_ERROR_INTERNAL);
        } else {
                /* If it is inside of the watch cb and if the previous request of this process has not been finished yet,
                 * the focus state mutex could be still locked. Therefore, it returns error here. */
@@ -342,7 +342,7 @@ int sound_manager_acquire_focus(sound_stream_info_h stream_info, sound_stream_fo
                        LOGE("It is not allowed in watch cb thread during the previous request has not been finished yet");
                        return _convert_sound_manager_error_code(__func__, MM_ERROR_SOUND_INVALID_OPERATION);
                }
-               SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_state_mutex, MM_ERROR_SOUND_INTERNAL);
+               SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_state_mutex, SOUND_MANAGER_ERROR_INTERNAL);
        }
 
        if (stream_h->acquired_focus & focus_mask) {
@@ -393,8 +393,8 @@ int sound_manager_release_focus(sound_stream_info_h stream_info, sound_stream_fo
                return _convert_sound_manager_error_code(__func__, ret);
 
        if (!is_focus_cb_thread) {
-               SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_cb_mutex, MM_ERROR_SOUND_INTERNAL);
-               SM_ENTER_CRITICAL_SECTION_WITH_UNLOCK_AND_RETURN(&stream_h->focus_state_mutex, &stream_h->focus_cb_mutex, MM_ERROR_SOUND_INTERNAL);
+               SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_cb_mutex, SOUND_MANAGER_ERROR_INTERNAL);
+               SM_ENTER_CRITICAL_SECTION_WITH_UNLOCK_AND_RETURN(&stream_h->focus_state_mutex, &stream_h->focus_cb_mutex, SOUND_MANAGER_ERROR_INTERNAL);
        } else {
                /* If it is inside of the watch cb and if the previous request of this process has not been finished yet,
                 * the focus state mutex could be still locked. Therefore, it returns error here. */
@@ -402,7 +402,7 @@ int sound_manager_release_focus(sound_stream_info_h stream_info, sound_stream_fo
                        LOGE("It is not allowed in watch cb thread during the previous request has not been finished yet");
                        return _convert_sound_manager_error_code(__func__, MM_ERROR_SOUND_INVALID_OPERATION);
                }
-               SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_state_mutex, MM_ERROR_SOUND_INTERNAL);
+               SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_state_mutex, SOUND_MANAGER_ERROR_INTERNAL);
        }
 
        if (!(stream_h->acquired_focus & focus_mask)) {
@@ -464,8 +464,8 @@ int sound_manager_acquire_focus_all(sound_stream_info_h stream_info, int sound_b
        }
 
        if (!is_focus_cb_thread) {
-               SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_cb_mutex, MM_ERROR_SOUND_INTERNAL);
-               SM_ENTER_CRITICAL_SECTION_WITH_UNLOCK_AND_RETURN(&stream_h->focus_state_mutex, &stream_h->focus_cb_mutex, MM_ERROR_SOUND_INTERNAL);
+               SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_cb_mutex, SOUND_MANAGER_ERROR_INTERNAL);
+               SM_ENTER_CRITICAL_SECTION_WITH_UNLOCK_AND_RETURN(&stream_h->focus_state_mutex, &stream_h->focus_cb_mutex, SOUND_MANAGER_ERROR_INTERNAL);
        } else {
                /* If it is inside of the watch cb and if the previous request of this process has not been finished yet,
                 * the focus state mutex could be still locked. Therefore, it returns error here. */
@@ -473,7 +473,7 @@ int sound_manager_acquire_focus_all(sound_stream_info_h stream_info, int sound_b
                        LOGE("It is not allowed in watch cb thread during the previous request has not been finished yet");
                        return _convert_sound_manager_error_code(__func__, MM_ERROR_SOUND_INVALID_OPERATION);
                }
-               SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_state_mutex, MM_ERROR_SOUND_INTERNAL);
+               SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_state_mutex, SOUND_MANAGER_ERROR_INTERNAL);
        }
 
        if (is_focus_cb_thread && (stream_h->prev_acquired_focus > stream_h->acquired_focus)) {
@@ -523,8 +523,8 @@ int sound_manager_release_focus_all(sound_stream_info_h stream_info, int sound_b
                return _convert_sound_manager_error_code(__func__, ret);
 
        if (!is_focus_cb_thread) {
-               SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_cb_mutex, MM_ERROR_SOUND_INTERNAL);
-               SM_ENTER_CRITICAL_SECTION_WITH_UNLOCK_AND_RETURN(&stream_h->focus_state_mutex, &stream_h->focus_cb_mutex, MM_ERROR_SOUND_INTERNAL);
+               SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_cb_mutex, SOUND_MANAGER_ERROR_INTERNAL);
+               SM_ENTER_CRITICAL_SECTION_WITH_UNLOCK_AND_RETURN(&stream_h->focus_state_mutex, &stream_h->focus_cb_mutex, SOUND_MANAGER_ERROR_INTERNAL);
        } else {
                /* If it is inside of the watch cb and if the previous request of this process has not been finished yet,
                 * the focus state mutex could be still locked. Therefore, it returns error here. */
@@ -532,7 +532,7 @@ int sound_manager_release_focus_all(sound_stream_info_h stream_info, int sound_b
                        LOGE("It is not allowed in watch cb thread during the previous request has not been finished yet");
                        return _convert_sound_manager_error_code(__func__, MM_ERROR_SOUND_INVALID_OPERATION);
                }
-               SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_state_mutex, MM_ERROR_SOUND_INTERNAL);
+               SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_state_mutex, SOUND_MANAGER_ERROR_INTERNAL);
        }
 
        if (is_focus_cb_thread && (stream_h->prev_acquired_focus < stream_h->acquired_focus)) {
@@ -576,7 +576,7 @@ int sound_manager_get_focus_state(sound_stream_info_h stream_info, sound_stream_
 
        LOGI(">> enter");
 
-       SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_state_mutex, MM_ERROR_SOUND_INTERNAL);
+       SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_state_mutex, SOUND_MANAGER_ERROR_INTERNAL);
 
        if (state_for_playback)
                *state_for_playback = ((stream_h->acquired_focus & SOUND_STREAM_FOCUS_FOR_PLAYBACK) ? (SOUND_STREAM_FOCUS_STATE_ACQUIRED) : (SOUND_STREAM_FOCUS_STATE_RELEASED));
index eb6054f01dbc15b52ececcda1c8182ed0755f6fe..7780dbd584d0ce4aa97780e6d549734731832d8e 100644 (file)
@@ -558,7 +558,7 @@ int sound_manager_set_virtual_stream_volume(virtual_sound_stream_h virtual_strea
 
        vstream_mutex = &vstream_h->stream_info->vstream_mutex;
 
-       SM_ENTER_CRITICAL_SECTION_WITH_RETURN(vstream_mutex, MM_ERROR_SOUND_INTERNAL);
+       SM_ENTER_CRITICAL_SECTION_WITH_RETURN(vstream_mutex, SOUND_MANAGER_ERROR_INTERNAL);
 
        ret = _set_virtual_stream_volume(vstream_h, ratio);