[0.2.96] Apply tizen coding rule 89/195889/6 accepted/tizen/unified/20190108.124902 submit/tizen/20190107.101656
authorGilbok Lee <gilbok.lee@samsung.com>
Wed, 19 Dec 2018 07:19:36 +0000 (16:19 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Thu, 20 Dec 2018 06:24:50 +0000 (15:24 +0900)
- modify space and brace
- Change FALSE to false, TRUE to true, if variable type is bool.
- Change postion of the variable declaration to top.

Change-Id: I245d6f0c7f8a9d2ed48f42905f49a31a80127f41

12 files changed:
legacy/include/legacy_player.h
legacy/include/legacy_player_internal.h
legacy/include/legacy_player_private.h
legacy/src/legacy_player.c
legacy/src/legacy_player_internal.c
muse/include/muse_player.h
muse/include/muse_player_msg.h
muse/include/muse_player_private.h
muse/src/muse_player.c
muse/src/muse_player_dispatcher.c
muse/test/build_verify.c
packaging/mmsvc-player.spec

index 40b861e..429192c 100644 (file)
@@ -1,18 +1,18 @@
 /*
-* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 #ifndef __TIZEN_MEDIA_LEGACY_PLAYER_H__
 #define __TIZEN_MEDIA_LEGACY_PLAYER_H__
@@ -134,14 +134,14 @@ typedef enum {
  * @brief The player display handle.
  * @since_tizen 2.3
  */
-typedef voidplayer_display_h;
+typedef void *player_display_h;
 
 #ifndef GET_DISPLAY
 /**
  * @brief Definition for a display handle from evas object.
  * @since_tizen 2.3
  */
-#define GET_DISPLAY(x) (void*)(x)
+#define GET_DISPLAY(x) (void *)(x)
 #endif
 
 /**
@@ -329,7 +329,7 @@ typedef bool (*legacy_player_media_packet_video_decoded_cb)(void *video_data, vo
  * @see legacy_player_set_media_stream_buffer_max_size()
  * @see legacy_player_set_media_stream_buffer_min_threshold()
  */
-typedef void (*player_media_stream_buffer_status_cb) (player_media_stream_buffer_status_e status, void *user_data);
+typedef void (*player_media_stream_buffer_status_cb)(player_media_stream_buffer_status_e status, void *user_data);
 
 /**
  * @brief Called to notify the next push-buffer offset when seeking is occurred.
@@ -339,7 +339,7 @@ typedef void (*player_media_stream_buffer_status_cb) (player_media_stream_buffer
  * @param[in] offset The new byte position to seek
  * @param[in] user_data The user data passed from the callback registration function
  */
-typedef void (*player_media_stream_seek_cb) (unsigned long long offset, void *user_data);
+typedef void (*player_media_stream_seek_cb)(unsigned long long offset, void *user_data);
 
 /**
  * @brief Called to notify the video stream changed.
@@ -354,7 +354,7 @@ typedef void (*player_media_stream_seek_cb) (unsigned long long offset, void *us
  * @param[in] user_data The user data passed from the callback registration function
  * @see legacy_player_set_video_stream_changed_cb()
  */
-typedef void (*player_video_stream_changed_cb) (int width, int height, int fps, int bit_rate, void *user_data);
+typedef void (*player_video_stream_changed_cb)(int width, int height, int fps, int bit_rate, void *user_data);
 
 #ifdef TIZEN_FEATURE_EVAS_RENDERER
 /**
@@ -454,7 +454,7 @@ int legacy_player_prepare(player_h player);
  * @see legacy_player_unprepare()
  * @see legacy_player_set_uri()
  */
-int legacy_player_prepare_async(player_h player, player_prepared_cb callback, voiduser_data);
+int legacy_player_prepare_async(player_h player, player_prepared_cb callback, void *user_data);
 
 /**
  * @brief Resets the media player.
@@ -496,7 +496,7 @@ int legacy_player_unprepare(player_h player);
  * @pre The player state must be set to #PLAYER_STATE_IDLE by calling legacy_player_create() or legacy_player_unprepare().
  * @see legacy_player_set_memory_buffer()
  */
-int legacy_player_set_uri(player_h player, const char * uri);
+int legacy_player_set_uri(player_h player, const char *uri);
 
 /**
  * @brief Sets memory as the data source.
@@ -518,7 +518,7 @@ int legacy_player_set_uri(player_h player, const char * uri);
  * @pre        The player state must be set to #PLAYER_STATE_IDLE by calling legacy_player_create() or legacy_player_unprepare().
  * @see legacy_player_set_uri()
  */
-int legacy_player_set_memory_buffer(player_h player, const void * data, int size);
+int legacy_player_set_memory_buffer(player_h player, const void *data, int size);
 
 /**
  * @brief Gets the player's current state.
@@ -828,7 +828,7 @@ int legacy_player_is_looping(player_h player, bool *looping);
  */
 int legacy_player_set_display(player_h player, player_display_type_e type, unsigned int wl_surface_id);
 
-int legacy_player_release_video_stream_bo(player_h player, voidbo);
+int legacy_player_release_video_stream_bo(player_h player, void *bo);
 
 /**
  * @brief Registers a media packet video callback function to be called once per frame.
@@ -1099,7 +1099,7 @@ int legacy_player_set_display_visible(player_h player, bool visible);
  * @retval  #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @see        legacy_player_set_display_visible()
  */
-int legacy_player_is_display_visible(player_h player, boolvisible);
+int legacy_player_is_display_visible(player_h player, bool *visible);
 
 /**
  * @brief Sets the rotation settings of the video surface display.
@@ -1159,7 +1159,7 @@ int legacy_player_get_display_rotation(player_h player, player_display_rotation_
  * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
  * @pre The player state must be one of these: #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING or #PLAYER_STATE_PAUSED.
  */
-int legacy_player_get_content_info(player_h player, player_content_info_e key, char ** value);
+int legacy_player_get_content_info(player_h player, player_content_info_e key, char **value);
 
 /**
  * @brief Gets the audio and video codec information.
@@ -1372,7 +1372,7 @@ int legacy_player_audio_effect_set_equalizer_all_bands(player_h player, int *ban
  * @see legacy_player_audio_effect_set_equalizer_band_level()
  * @see legacy_player_audio_effect_set_equalizer_all_bands()
  */
-int legacy_player_audio_effect_get_equalizer_level_range(player_h player, int* min, int* max);
+int legacy_player_audio_effect_get_equalizer_level_range(player_h player, int *min, int *max);
 
 /**
  * @brief Gets the band frequency of the equalizer.
@@ -2134,4 +2134,3 @@ int legacy_player_is_replaygain_enabled(player_h player, bool *enabled);
 #endif
 
 #endif /* __TIZEN_MEDIA_LEGACY_PLAYER_H__ */
-
index de70958..a2ca551 100644 (file)
@@ -1,18 +1,18 @@
 /*
-* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 #ifndef __TIZEN_MEDIA_LEGACY_PLAYER_INTERNAL_H__
 #define        __TIZEN_MEDIA_LEGACY_PLAYER_INTERNAL_H__
@@ -77,7 +77,7 @@ typedef void (*player_audio_pcm_extraction_cb)(player_audio_raw_data_s *audio_ra
  * @see legacy_player_set_media_stream_buffer_max_size()
  * @see legacy_player_set_media_stream_buffer_min_threshold()
  */
-typedef void (*player_media_stream_buffer_status_cb_ex) (player_media_stream_buffer_status_e status, unsigned long long bytes, void *user_data);
+typedef void (*player_media_stream_buffer_status_cb_ex)(player_media_stream_buffer_status_e status, unsigned long long bytes, void *user_data);
 
 /**
  * @brief Registers a callback function to be invoked when audio frame is decoded. Audio only contents is possible. If included video, error happens.
@@ -262,7 +262,7 @@ int legacy_player_set_gapless(player_h player, bool gapless);
  */
 int legacy_player_is_gapless(player_h player, bool *gapless);
 
- /**
+/**
  * @brief Enables media_packet callback
  * @since_tizen 3.0
  * @details If it is @c true, media_packet callback will be activated.
@@ -326,5 +326,3 @@ int legacy_player_get_codec_type(player_h player, player_stream_type_e stream_ty
 #endif
 
 #endif //__TIZEN_MEDIA_LEGACY_PLAYER_INTERNAL_H__
-
-
index 90d5b56..f638d70 100644 (file)
@@ -1,18 +1,18 @@
 /*
-* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 #ifndef __TIZEN_MEDIA_LEGACY_PLAYER_PRIVATE_H__
 #define        __TIZEN_MEDIA_LEGACY_PLAYER_PRIVATE_H__
@@ -24,10 +24,10 @@ extern "C" {
 #endif
 
 #define PLAYER_CHECK_CONDITION(condition, error, msg)     \
-do {   \
-       if (condition) {} else \
-       { LOGE("[%s] %s(0x%08x)", __FUNCTION__, msg, error); return error; } \
-} while (0)
+       do {    \
+               if (condition) {} else \
+               { LOGE("[%s] %s(0x%08x)", __FUNCTION__, msg, error); return error; } \
+       } while (0)
 
 #define PLAYER_INSTANCE_CHECK(player)   \
        PLAYER_CHECK_CONDITION(player != NULL, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER")
@@ -39,22 +39,22 @@ do {        \
        PLAYER_CHECK_CONDITION((arg), PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER")
 
 #define PLAYER_RANGE_ARG_CHECK(arg, min, max)      \
-do {   \
-       PLAYER_CHECK_CONDITION(arg <= max, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");   \
-       PLAYER_CHECK_CONDITION(arg >= min, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");   \
-} while (0)
+       do {    \
+               PLAYER_CHECK_CONDITION(arg <= max, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");   \
+               PLAYER_CHECK_CONDITION(arg >= min, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");   \
+       } while (0)
 
 /* user_cb_lock */
 #define LEGACY_PLAYER_USER_CB_LOCK(x_handle, type) \
        do { \
                if (_check_enabled_user_cb_lock(type))  \
-                       g_mutex_lock(&((player_s*)x_handle)->user_cb_lock[type]);       \
+                       g_mutex_lock(&((player_s *)x_handle)->user_cb_lock[type]);      \
        } while (0)
 
 #define LEGACY_PLAYER_USER_CB_UNLOCK(x_handle, type) \
        do { \
                if (_check_enabled_user_cb_lock(type))  \
-                       g_mutex_unlock(&((player_s*)x_handle)->user_cb_lock[type]);     \
+                       g_mutex_unlock(&((player_s *)x_handle)->user_cb_lock[type]);    \
        } while (0)
 
 
@@ -99,11 +99,11 @@ typedef enum {
 
 typedef struct _player_s {
        MMHandleType mm_handle;
-       const voiduser_cb[MUSE_PLAYER_EVENT_TYPE_NUM];
-       voiduser_data[MUSE_PLAYER_EVENT_TYPE_NUM];
+       const void *user_cb[MUSE_PLAYER_EVENT_TYPE_NUM];
+       void *user_data[MUSE_PLAYER_EVENT_TYPE_NUM];
        GMutex user_cb_lock[MUSE_PLAYER_EVENT_TYPE_NUM];
-       voidwl_display;
-       voiddisplay_handle;
+       void *wl_display;
+       void *display_handle;
        player_display_type_e display_type;
        player_state_e state;
        player_internal_state_e internal_state;
@@ -119,8 +119,8 @@ typedef struct _player_s {
        int64_t last_play_position;
 } player_s;
 
-int __player_convert_error_code(int code, charfunc_name);
-bool __player_state_validate(player_s * handle, player_state_e threshold);
+int __player_convert_error_code(int code, char *func_name);
+bool __player_state_validate(player_s *handle, player_state_e threshold);
 
 #ifdef __cplusplus
 }
index 5838f64..17455fc 100644 (file)
@@ -1,18 +1,18 @@
 /*
-* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -80,8 +80,8 @@
        } while (0)
 
 /*
-* Internal Implementation
-*/
+ * Internal Implementation
+ */
 int __player_convert_error_code(int code, char *func_name)
 {
        int ret = PLAYER_ERROR_INVALID_OPERATION;
@@ -278,15 +278,16 @@ bool __player_state_validate(player_s *handle, player_state_e threshold)
 {
        if (handle->state < threshold)
                return false;
+
        return true;
 }
 
 static int __set_callback(muse_player_event_e type, player_h player, void *callback, void *user_data)
 {
+       player_s *handle = (player_s *)player;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(callback);
 
-       player_s *handle = (player_s *)player;
        handle->user_cb[type] = callback;
        handle->user_data[type] = user_data;
        LOGI("[%s] Event type : %d ", __FUNCTION__, type);
@@ -295,8 +296,8 @@ static int __set_callback(muse_player_event_e type, player_h player, void *callb
 
 static int __unset_callback(muse_player_event_e type, player_h player)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       PLAYER_INSTANCE_CHECK(player);
        handle->user_cb[type] = NULL;
        handle->user_data[type] = NULL;
        LOGI("[%s] Event type : %d ", __FUNCTION__, type);
@@ -305,7 +306,7 @@ static int __unset_callback(muse_player_event_e type, player_h player)
 
 static void __message_cb_loop(void *data)
 {
-       bool running = TRUE;
+       bool running = true;
        player_s *handle = (player_s *)data;
        if (!handle) {
                LOGE("null handle in __message_cb_loop");
@@ -317,7 +318,7 @@ static void __message_cb_loop(void *data)
                case PLAYER_MESSAGE_NONE:
                        {
                                LOGW("PLAYER_MESSAGE_NONE");
-                               running = FALSE;
+                               running = false;
                        }
                        break;
                case PLAYER_MESSAGE_PREPARED:
@@ -370,24 +371,23 @@ static void __message_cb_loop(void *data)
                case PLAYER_MESSAGE_GAPLESS_CONSTRUCTION:
                        {
                                LOGW("PLAYER_MESSAGE_GAPLESS_CONSTRUCTION");
-                               if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER]) {
+                               if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER])
                                        ((player_retrieve_buffer_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER])(handle->user_data[MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER]);
-                               } else {
+                               else
                                        LOGE("null handle in PLAYER_MESSAGE_GAPLESS_CONSTRUCTION");
-                               }
                        }
                        break;
 #endif
                case PLAYER_MESSAGE_LOOP_EXIT:
                        {
                                LOGW("PLAYER_MESSAGE_LOOP_EXIT");
-                               running = FALSE;
+                               running = false;
                        }
                        break;
                case PLAYER_MESSAGE_MAX:
                        {
                                LOGW("PLAYER_MESSAGE_MAX");
-                               running = FALSE;
+                               running = false;
                        }
                        break;
                default:
@@ -401,8 +401,8 @@ static player_state_e __convert_player_state(MMPlayerStateType state)
 {
        if (state == MM_PLAYER_STATE_NONE)
                return PLAYER_STATE_NONE;
-       else
-               return state +1;
+
+       return state + 1;
 }
 
 static int __msg_callback(int message, void *param, void *user_data)
@@ -443,15 +443,13 @@ static int __msg_callback(int message, void *param, void *user_data)
                LOGI("[%s] Ready to streaming information (BOS) [current state : %d]", __FUNCTION__, handle->state);
                break;
        case MM_MESSAGE_END_OF_STREAM:  /* 0x105 */
-               if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_COMPLETE]) {
+               if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_COMPLETE])
                        __ADD_MESSAGE(handle, PLAYER_MESSAGE_EOS);
-               }
                break;
 #ifdef TIZEN_FEATURE_EVAS_RENDERER
        case MM_MESSAGE_GAPLESS_CONSTRUCTION:   /* 0x105 */
-               if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER]) {
+               if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER])
                        __ADD_MESSAGE(handle, PLAYER_MESSAGE_GAPLESS_CONSTRUCTION);
-               }
                break;
 #endif
        case MM_MESSAGE_BUFFERING:      /* 0x103 */
@@ -503,7 +501,7 @@ static int __msg_callback(int message, void *param, void *user_data)
                }
 
                /* capure->data have to be released to avoid mem leak in all cases. */
-               if (capture && capture->data) {
+               if (capture) {
                        g_free(capture->data);
                        capture->data = NULL;
                }
@@ -577,78 +575,78 @@ bool _check_enabled_user_cb_lock(int type)
        case MUSE_PLAYER_EVENT_TYPE_PREPARE:          /* fall through */
        case MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_BUFFER_STATUS_WITH_INFO:    /* fall through */
        case MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS_WITH_INFO:    /* fall through */
-               return TRUE;
+               return true;
        default:
-               return FALSE;
+               return false;
        }
 }
 
 /*
-* Public Implementation
-*/
+ * Public Implementation
+ */
 
 int legacy_player_create(player_h *player)
 {
+       player_s *handle;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_TRACE_BEGIN("MM:PLAYER:CREATE");
-       player_s *handle;
        handle = g_try_new0(player_s, 1);
        if (!handle) {
                LOGE("[%s] PLAYER_ERROR_OUT_OF_MEMORY(0x%08x)", __FUNCTION__, PLAYER_ERROR_OUT_OF_MEMORY);
                return PLAYER_ERROR_OUT_OF_MEMORY;
        }
-       int ret = mm_player_create(&handle->mm_handle);
+       ret = mm_player_create(&handle->mm_handle);
        if (ret != MM_ERROR_NONE) {
                LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION(0x%08x)", __FUNCTION__, PLAYER_ERROR_INVALID_OPERATION);
                __player_update_state(handle, PLAYER_INTERNAL_STATE_NONE);
                g_free(handle);
                handle = NULL;
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               muse_player_event_e type = MUSE_PLAYER_EVENT_TYPE_PREPARE;
+       }
 
-               *player = (player_h)handle;
-               __player_update_state(handle, PLAYER_INTERNAL_STATE_IDLE);
-               handle->display_type = PLAYER_DISPLAY_TYPE_NONE;
-               handle->is_display_visible = TRUE;
-               handle->is_media_stream = FALSE;
+       muse_player_event_e type = MUSE_PLAYER_EVENT_TYPE_PREPARE;
 
-               for (type = MUSE_PLAYER_EVENT_TYPE_PREPARE; type < MUSE_PLAYER_EVENT_TYPE_NUM; type++) {
-                       if (_check_enabled_user_cb_lock(type))
-                               g_mutex_init(&handle->user_cb_lock[type]);
-               }
+       *player = (player_h)handle;
+       __player_update_state(handle, PLAYER_INTERNAL_STATE_IDLE);
+       handle->display_type = PLAYER_DISPLAY_TYPE_NONE;
+       handle->is_display_visible = true;
+       handle->is_media_stream = false;
 
-               handle->message_queue = g_queue_new();
-               g_mutex_init(&handle->message_queue_lock);
-               g_cond_init(&handle->message_queue_cond);
-               ret = pthread_create(&handle->message_thread, NULL, (void *)__message_cb_loop, (void *)handle);
-               if (ret != 0) {
-                       LOGE("[%s] failed to create message thread ret = %d", __FUNCTION__, ret);
-                       return PLAYER_ERROR_OUT_OF_MEMORY;
-               }
+       for (type = MUSE_PLAYER_EVENT_TYPE_PREPARE; type < MUSE_PLAYER_EVENT_TYPE_NUM; type++) {
+               if (_check_enabled_user_cb_lock(type))
+                       g_mutex_init(&handle->user_cb_lock[type]);
+       }
 
-               LOGI("[%s] new handle : %p", __FUNCTION__, *player);
-               PLAYER_TRACE_END();
-               return PLAYER_ERROR_NONE;
+       handle->message_queue = g_queue_new();
+       g_mutex_init(&handle->message_queue_lock);
+       g_cond_init(&handle->message_queue_cond);
+       ret = pthread_create(&handle->message_thread, NULL, (void *)__message_cb_loop, (void *)handle);
+       if (ret != 0) {
+               LOGE("[%s] failed to create message thread ret = %d", __FUNCTION__, ret);
+               return PLAYER_ERROR_OUT_OF_MEMORY;
        }
+
+       LOGI("[%s] new handle : %p", __FUNCTION__, *player);
+       PLAYER_TRACE_END();
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_destroy(player_h player)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        LOGI("[%s] Start, handle to destroy : %p", __FUNCTION__, player);
        PLAYER_TRACE_BEGIN("MM:PLAYER:DESTROY");
        PLAYER_INSTANCE_CHECK(player);
-       player_s *handle = (player_s *)player;
 
        __ADD_MESSAGE(handle, PLAYER_MESSAGE_LOOP_EXIT);
 
        LEGACY_PLAYER_USER_CB_LOCK(handle, MUSE_PLAYER_EVENT_TYPE_PREPARE);
        if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE]) {
                handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE] = NULL;
-               if (handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE]) {
-                       g_free(handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE]);
-                       handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE] = NULL;
-               }
+               g_free(handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE]);
+               handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE] = NULL;
        }
        LEGACY_PLAYER_USER_CB_UNLOCK(handle, MUSE_PLAYER_EVENT_TYPE_PREPARE);
 
@@ -659,38 +657,36 @@ int legacy_player_destroy(player_h player)
        __RELEASEIF_PREPARE_THREAD(handle->prepare_async_thread);
        __RELEASEIF_MESSAGE_THREAD(handle->message_thread);
 
-       int ret = mm_player_destroy(handle->mm_handle);
-
-       LOGI("[%s] Done mm_player_destroy", __FUNCTION__);
-
+       ret = mm_player_destroy(handle->mm_handle);
        if (ret != MM_ERROR_NONE) {
                LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION(0x%08x)", __FUNCTION__, PLAYER_ERROR_INVALID_OPERATION);
                return PLAYER_ERROR_INVALID_OPERATION;
-       } else {
-               muse_player_event_e type = MUSE_PLAYER_EVENT_TYPE_PREPARE;
-
-               __player_update_state(handle, PLAYER_INTERNAL_STATE_NONE);
+       }
+       LOGI("[%s] Done mm_player_destroy", __FUNCTION__);
 
-               for (type = MUSE_PLAYER_EVENT_TYPE_PREPARE; type < MUSE_PLAYER_EVENT_TYPE_NUM; type++) {
-                       if (_check_enabled_user_cb_lock(type))
-                               g_mutex_clear(&handle->user_cb_lock[type]);
-               }
+       muse_player_event_e type = MUSE_PLAYER_EVENT_TYPE_PREPARE;
 
-               if (handle->message_queue) {
-                       g_queue_free(handle->message_queue);
-                       handle->message_queue = NULL;
-               }
+       __player_update_state(handle, PLAYER_INTERNAL_STATE_NONE);
 
-               g_cond_broadcast(&handle->message_queue_cond);
-               g_mutex_clear(&handle->message_queue_lock);
-               g_cond_clear(&handle->message_queue_cond);
+       for (type = MUSE_PLAYER_EVENT_TYPE_PREPARE; type < MUSE_PLAYER_EVENT_TYPE_NUM; type++) {
+               if (_check_enabled_user_cb_lock(type))
+                       g_mutex_clear(&handle->user_cb_lock[type]);
+       }
 
-               g_free(handle);
-               handle = NULL;
-               LOGI("[%s] End", __FUNCTION__);
-               PLAYER_TRACE_END();
-               return PLAYER_ERROR_NONE;
+       if (handle->message_queue) {
+               g_queue_free(handle->message_queue);
+               handle->message_queue = NULL;
        }
+
+       g_cond_broadcast(&handle->message_queue_cond);
+       g_mutex_clear(&handle->message_queue_lock);
+       g_cond_clear(&handle->message_queue_cond);
+
+       g_free(handle);
+       handle = NULL;
+       LOGI("[%s] End", __FUNCTION__);
+       PLAYER_TRACE_END();
+       return PLAYER_ERROR_NONE;
 }
 
 static void *__prepare_async_thread_func(void *data)
@@ -720,13 +716,13 @@ static void *__prepare_async_thread_func(void *data)
 
 int legacy_player_prepare_async(player_h player, player_prepared_cb callback, void *user_data)
 {
+       player_s *handle = (player_s *)player;
        int ret = MM_ERROR_NONE;
        int visible = 0;
        int value = 0;
 
        LOGI("[%s] Start", __FUNCTION__);
        PLAYER_INSTANCE_CHECK(player);
-       player_s *handle = (player_s *)player;
        PLAYER_TRACE_ASYNC_BEGIN("MM:PLAYER:PREPARE_ASYNC", *(int *)handle);
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
 
@@ -739,11 +735,12 @@ int legacy_player_prepare_async(player_h player, player_prepared_cb callback, vo
                LEGACY_PLAYER_USER_CB_UNLOCK(handle, MUSE_PLAYER_EVENT_TYPE_PREPARE);
                __player_update_state(handle, PLAYER_INTERNAL_STATE_IDLE);
                return PLAYER_ERROR_INVALID_OPERATION;
-       } else {
-               /* LOGI("[%s] Event type : %d ",__FUNCTION__, MUSE_PLAYER_EVENT_TYPE_PREPARE); */
-               handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE] = callback;
-               handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE] = user_data;
        }
+
+       /* LOGI("[%s] Event type : %d ",__FUNCTION__, MUSE_PLAYER_EVENT_TYPE_PREPARE); */
+       handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE] = callback;
+       handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE] = user_data;
+
        LEGACY_PLAYER_USER_CB_UNLOCK(handle, MUSE_PLAYER_EVENT_TYPE_PREPARE);
 
        ret = mm_player_set_message_callback(handle->mm_handle, __msg_callback, (void *)handle);
@@ -812,12 +809,11 @@ int legacy_player_prepare(player_h player)
 {
        int ret = MM_ERROR_NONE;
        int visible = 0;
-       int value = 0;
+       player_s *handle = (player_s *)player;
 
        LOGI("[%s] Start", __FUNCTION__);
        PLAYER_TRACE_BEGIN("MM:PLAYER:PREPARE");
        PLAYER_INSTANCE_CHECK(player);
-       player_s *handle = (player_s *)player;
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
        __player_update_state(handle, PLAYER_INTERNAL_STATE_PRE_READY);
 
@@ -837,15 +833,9 @@ int legacy_player_prepare(player_h player)
                        return __player_convert_error_code(ret, (char *)__FUNCTION__);
                }
 
-               if (!visible)
-                       value = FALSE;
-               else
-                       value = TRUE;
-
-               ret = mm_player_set_attribute(handle->mm_handle, NULL, "display_visible", value, (char *)NULL);
-
+               ret = mm_player_set_attribute(handle->mm_handle, NULL, "display_visible", visible, (char *)NULL);
                if (ret != MM_ERROR_NONE)
-                       LOGW("[%s] Failed to set display display_visible '0' (0x%x)", __FUNCTION__, ret);
+                       LOGW("[%s] Failed to set display display_visible '%d' (0x%x)", __FUNCTION__, visible, ret);
        }
 
        ret = mm_player_realize(handle->mm_handle);
@@ -865,20 +855,21 @@ int legacy_player_prepare(player_h player)
                LOGE("[%s] Failed to pause - 0x%x", __FUNCTION__, ret);
                __player_update_state(handle, PLAYER_INTERNAL_STATE_IDLE);
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               __player_update_state(handle, PLAYER_INTERNAL_STATE_READY);
-               LOGI("[%s] End", __FUNCTION__);
-               PLAYER_TRACE_END();
-               return PLAYER_ERROR_NONE;
        }
+
+       __player_update_state(handle, PLAYER_INTERNAL_STATE_READY);
+       LOGI("[%s] End", __FUNCTION__);
+       PLAYER_TRACE_END();
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_unprepare(player_h player)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        LOGI("[%s] Start", __FUNCTION__);
        PLAYER_TRACE_BEGIN("MM:PLAYER:UNPREPARE");
        PLAYER_INSTANCE_CHECK(player);
-       player_s *handle = (player_s *)player;
 
        /* Initialize the setting regardless of error return */
        if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK]) {
@@ -895,10 +886,8 @@ int legacy_player_unprepare(player_h player)
        if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE]) {
                LOGW("Need to check. prepare cb have to be reset before");
                handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE] = NULL;
-               if (handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE]) {
-                       g_free(handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE]);
-                       handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE] = NULL;
-               }
+               g_free(handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE]);
+               handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE] = NULL;
        }
        LEGACY_PLAYER_USER_CB_UNLOCK(handle, MUSE_PLAYER_EVENT_TYPE_PREPARE);
 
@@ -908,161 +897,165 @@ int legacy_player_unprepare(player_h player)
 
        __RELEASEIF_PREPARE_THREAD(handle->prepare_async_thread);
 
-       int ret = mm_player_unrealize(handle->mm_handle);
-
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_unrealize(handle->mm_handle);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               __player_update_state(handle, PLAYER_INTERNAL_STATE_IDLE);
-               handle->is_display_visible = TRUE;
-               LOGI("[%s] End", __FUNCTION__);
-               PLAYER_TRACE_END();
-               return PLAYER_ERROR_NONE;
-       }
+
+       __player_update_state(handle, PLAYER_INTERNAL_STATE_IDLE);
+       handle->is_display_visible = true;
+       LOGI("[%s] End", __FUNCTION__);
+       PLAYER_TRACE_END();
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_uri(player_h player, const char *uri)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(uri);
-       player_s *handle = (player_s *)player;
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
 
-       handle->is_media_stream = FALSE;
-       int ret = mm_player_set_uri(handle->mm_handle, uri);
-
+       handle->is_media_stream = false;
+       ret = mm_player_set_uri(handle->mm_handle, uri);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_memory_buffer(player_h player, const void *data, int size)
 {
+       player_s *handle = (player_s *)player;
+       char uri[PATH_MAX];
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(data);
        PLAYER_CHECK_CONDITION(size >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-       player_s *handle = (player_s *)player;
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
-       char uri[PATH_MAX];
 
        handle->is_media_stream = FALSE;
 
        snprintf(uri, sizeof(uri), "mem:///ext=%s,size=%d", "", size);
-       int ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_CONTENT_URI, uri, strlen(uri), MM_PLAYER_MEMORY_SRC, data, size, (char *)NULL);
+       ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_CONTENT_URI, uri, strlen(uri), MM_PLAYER_MEMORY_SRC, data, size, (char *)NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_state(player_h player, player_state_e *state)
 {
+       player_s *handle = (player_s *)player;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(state);
-       player_s *handle = (player_s *)player;
        *state = handle->state;
        return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_volume(player_h player, float left, float right)
 {
+       player_s *handle = (player_s *)player;
+       MMPlayerVolumeType vol;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_CHECK_CONDITION(left >= 0 && left <= 1.0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
        PLAYER_CHECK_CONDITION(right >= 0 && right <= 1.0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-       player_s *handle = (player_s *)player;
-       MMPlayerVolumeType vol;
+
        vol.level[MM_VOLUME_CHANNEL_LEFT] = left;
        vol.level[MM_VOLUME_CHANNEL_RIGHT] = right;
-       int ret = mm_player_set_volume(handle->mm_handle, &vol);
+       ret = mm_player_set_volume(handle->mm_handle, &vol);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_volume(player_h player, float *left, float *right)
 {
+       player_s *handle = (player_s *)player;
+       MMPlayerVolumeType vol;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(left);
        PLAYER_NULL_ARG_CHECK(right);
-       player_s *handle = (player_s *)player;
-       MMPlayerVolumeType vol;
-       int ret = mm_player_get_volume(handle->mm_handle, &vol);
+
+       ret = mm_player_get_volume(handle->mm_handle, &vol);
        if (ret != MM_ERROR_NONE) {
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               *left = vol.level[MM_VOLUME_CHANNEL_LEFT];
-               *right = vol.level[MM_VOLUME_CHANNEL_RIGHT];
-               return PLAYER_ERROR_NONE;
        }
+
+       *left = vol.level[MM_VOLUME_CHANNEL_LEFT];
+       *right = vol.level[MM_VOLUME_CHANNEL_RIGHT];
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_sound_stream_info(player_h player, sound_stream_info_h stream_info)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       bool is_available = false;
+       PLAYER_INSTANCE_CHECK(player);
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
 
-       bool is_available = FALSE;
-
        /* check if stream_info is valid */
-       int ret = sound_manager_is_available_stream_information(stream_info, NATIVE_API_PLAYER, &is_available);
-
-       if (ret != MM_ERROR_NONE) {
+       ret = sound_manager_is_available_stream_information(stream_info, NATIVE_API_PLAYER, &is_available);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
+
+       if (is_available) {
+               char *stream_type = NULL;
+               int stream_index = 0;
+               ret = sound_manager_get_type_from_stream_information(stream_info, &stream_type);
+               ret = sound_manager_get_index_from_stream_information(stream_info, &stream_index);
+               if (ret == SOUND_MANAGER_ERROR_NONE)
+                       ret = mm_player_set_sound_stream_info(handle->mm_handle, stream_type, stream_index);
+               else
+                       ret = MM_ERROR_PLAYER_INTERNAL;
        } else {
-               if (is_available == FALSE)
-                       ret = MM_ERROR_NOT_SUPPORT_API;
-               else {
-                       char *stream_type = NULL;
-                       int stream_index = 0;
-                       ret = sound_manager_get_type_from_stream_information(stream_info, &stream_type);
-                       ret = sound_manager_get_index_from_stream_information(stream_info, &stream_index);
-                       if (ret == SOUND_MANAGER_ERROR_NONE)
-                               ret = mm_player_set_sound_stream_info(handle->mm_handle, stream_type, stream_index);
-                       else
-                               ret = MM_ERROR_PLAYER_INTERNAL;
-               }
+               ret = MM_ERROR_NOT_SUPPORT_API;
        }
 
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_audio_latency_mode(player_h player, audio_latency_mode_e latency_mode)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
-       int ret = mm_player_set_attribute(handle->mm_handle, NULL, "sound_latency_mode", latency_mode, (char *)NULL);
+       ret = mm_player_set_attribute(handle->mm_handle, NULL, "sound_latency_mode", latency_mode, (char *)NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
-int legacy_player_get_audio_latency_mode(player_h player, audio_latency_mode_e * latency_mode)
+int legacy_player_get_audio_latency_mode(player_h player, audio_latency_mode_e *latency_mode)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(latency_mode);
-       player_s *handle = (player_s *)player;
 
-       int ret = mm_player_get_attribute(handle->mm_handle, NULL, "sound_latency_mode", latency_mode, (char *)NULL);
+       ret = mm_player_get_attribute(handle->mm_handle, NULL, "sound_latency_mode", latency_mode, (char *)NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_start(player_h player)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        LOGI("[%s] Start", __FUNCTION__);
        PLAYER_INSTANCE_CHECK(player);
-       player_s *handle = (player_s *)player;
-       int ret;
+
        if (handle->state > PLAYER_STATE_IDLE) {
                if (handle->display_type == PLAYER_DISPLAY_TYPE_OVERLAY && handle->is_display_visible) {
                        ret = mm_player_set_attribute(handle->mm_handle, NULL, "display_visible", 1, (char *)NULL);
@@ -1083,21 +1076,20 @@ int legacy_player_start(player_h player)
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       if (ret != MM_ERROR_NONE) {
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               __player_update_state(handle, PLAYER_INTERNAL_STATE_PLAYING);
-               LOGI("[%s] End", __FUNCTION__);
-               return PLAYER_ERROR_NONE;
-       }
+
+       __player_update_state(handle, PLAYER_INTERNAL_STATE_PLAYING);
+       LOGI("[%s] End", __FUNCTION__);
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_stop(player_h player)
 {
-       LOGI("[%s] Start", __FUNCTION__);
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
        int ret = MM_ERROR_NONE;
+       LOGI("[%s] Start", __FUNCTION__);
+       PLAYER_INSTANCE_CHECK(player);
 
        if (handle->state == PLAYER_STATE_PLAYING || handle->state == PLAYER_STATE_PAUSED) {
                if (handle->display_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
@@ -1109,60 +1101,63 @@ int legacy_player_stop(player_h player)
                ret = mm_player_stop(handle->mm_handle);
                if (ret != MM_ERROR_NONE) {
                        return __player_convert_error_code(ret, (char *)__FUNCTION__);
-               } else {
-                       if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK]) {
-                               handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK] = NULL;
-                               handle->user_data[MUSE_PLAYER_EVENT_TYPE_SEEK] = NULL;
-                       }
-
-                       __player_update_state(handle, PLAYER_INTERNAL_STATE_STOPPED);
+               }
 
-                       LOGI("[%s] End", __FUNCTION__);
-                       return PLAYER_ERROR_NONE;
+               if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK]) {
+                       handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK] = NULL;
+                       handle->user_data[MUSE_PLAYER_EVENT_TYPE_SEEK] = NULL;
                }
-       } else {
-               LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
-               return PLAYER_ERROR_INVALID_STATE;
+
+               __player_update_state(handle, PLAYER_INTERNAL_STATE_STOPPED);
+
+               LOGI("[%s] End", __FUNCTION__);
+               return PLAYER_ERROR_NONE;
        }
+
+       LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
+       return PLAYER_ERROR_INVALID_STATE;
 }
 
 int legacy_player_pause(player_h player)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        LOGI("[%s] Start", __FUNCTION__);
        PLAYER_INSTANCE_CHECK(player);
-       player_s *handle = (player_s *)player;
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_PLAYING);
 
-       int ret = mm_player_pause(handle->mm_handle);
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_pause(handle->mm_handle);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               __player_update_state(handle, PLAYER_INTERNAL_STATE_PAUSED);
-               LOGI("[%s] End", __FUNCTION__);
-               return PLAYER_ERROR_NONE;
-       }
+
+       __player_update_state(handle, PLAYER_INTERNAL_STATE_PAUSED);
+       LOGI("[%s] End", __FUNCTION__);
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_play_position(player_h player, int64_t nanoseconds, bool accurate, player_seek_completed_cb callback, void *user_data)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       int accurated = accurate ? 1 : 0;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_CHECK_CONDITION(nanoseconds >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-       player_s *handle = (player_s *)player;
+
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK] && handle->is_media_stream == FALSE) {
+       if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK] && !handle->is_media_stream) {
                LOGE("[%s] PLAYER_ERROR_SEEK_FAILED temp (0x%08x) : seeking... we can't do any more ", __FUNCTION__, PLAYER_ERROR_SEEK_FAILED);
                return PLAYER_ERROR_SEEK_FAILED;
-       } else {
-               LOGI("[%s] Event type : %d, pos : %"PRId64, __FUNCTION__, MUSE_PLAYER_EVENT_TYPE_SEEK, nanoseconds);
-               handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK] = callback;
-               handle->user_data[MUSE_PLAYER_EVENT_TYPE_SEEK] = user_data;
        }
-       int accurated = accurate ? 1 : 0;
-       int ret = mm_player_set_attribute(handle->mm_handle, NULL, "accurate_seek", accurated, (char *)NULL);
+
+       LOGI("[%s] Event type : %d, pos : %"PRId64, __FUNCTION__, MUSE_PLAYER_EVENT_TYPE_SEEK, nanoseconds);
+       handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK] = callback;
+       handle->user_data[MUSE_PLAYER_EVENT_TYPE_SEEK] = user_data;
+
+       ret = mm_player_set_attribute(handle->mm_handle, NULL, "accurate_seek", accurated, (char *)NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
 
@@ -1171,24 +1166,25 @@ int legacy_player_set_play_position(player_h player, int64_t nanoseconds, bool a
                handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK] = NULL;
                handle->user_data[MUSE_PLAYER_EVENT_TYPE_SEEK] = NULL;
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               return PLAYER_ERROR_NONE;
        }
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_play_position(player_h player, int64_t *nanoseconds)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        int64_t pos = 0;
-
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(nanoseconds);
-       player_s *handle = (player_s *)player;
+
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       int ret = mm_player_get_position(handle->mm_handle, &pos);
+       ret = mm_player_get_position(handle->mm_handle, &pos);
        if (ret != MM_ERROR_NONE) {
                if (ret == MM_ERROR_PLAYER_NOT_INITIALIZED) {
                        /* During playbak if a interrupt is occurred, the player can be destroyed internally.
@@ -1202,89 +1198,83 @@ int legacy_player_get_play_position(player_h player, int64_t *nanoseconds)
                                return PLAYER_ERROR_NONE;
                        }
                }
-
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               *nanoseconds = pos;
-               return PLAYER_ERROR_NONE;
        }
+
+       *nanoseconds = pos;
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_mute(player_h player, bool muted)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
-       int ret = mm_player_set_mute(handle->mm_handle, muted);
+       ret = mm_player_set_mute(handle->mm_handle, muted);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_is_muted(player_h player, bool *muted)
 {
+       player_s *handle = (player_s *)player;
+       int _mute;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(muted);
-       player_s *handle = (player_s *)player;
 
-       int _mute;
-       int ret = mm_player_get_mute(handle->mm_handle, &_mute);
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_get_mute(handle->mm_handle, &_mute);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               if (_mute)
-                       *muted = TRUE;
-               else
-                       *muted = FALSE;
-               return PLAYER_ERROR_NONE;
-       }
+
+       *muted = (bool)_mute;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_looping(player_h player, bool looping)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
-
+       int ret = MM_ERROR_NONE;
        int value = 0;
-       if (looping == TRUE)
-               value = -1;
+       PLAYER_INSTANCE_CHECK(player);
 
-       int ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_PLAYBACK_COUNT, value, (char *)NULL);
+       if (looping)
+               value = -1;
 
+       ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_PLAYBACK_COUNT, value, (char *)NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_is_looping(player_h player, bool *looping)
 {
-       PLAYER_INSTANCE_CHECK(player);
-       PLAYER_NULL_ARG_CHECK(looping);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        int count;
+       PLAYER_INSTANCE_CHECK(player);
+       PLAYER_NULL_ARG_CHECK(looping);
 
-       int ret = mm_player_get_attribute(handle->mm_handle, NULL, MM_PLAYER_PLAYBACK_COUNT, &count, (char *)NULL);
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_get_attribute(handle->mm_handle, NULL, MM_PLAYER_PLAYBACK_COUNT, &count, (char *)NULL);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               if (count == -1)
-                       *looping = TRUE;
-               else
-                       *looping = FALSE;
 
-               return PLAYER_ERROR_NONE;
-       }
+       *looping = (count == -1) ? true : false;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_duration(player_h player, int64_t *duration)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(duration);
-       int ret = MM_ERROR_NONE;
-
-       player_s *handle = (player_s *)player;
 
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
@@ -1292,9 +1282,8 @@ int legacy_player_get_duration(player_h player, int64_t *duration)
        }
 
        ret = mm_player_get_duration(handle->mm_handle, duration);
-       if (ret != MM_ERROR_NONE) {
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       }
 
        LOGD("content dur: %"PRId64, *duration);
        return PLAYER_ERROR_NONE;
@@ -1302,43 +1291,46 @@ int legacy_player_get_duration(player_h player, int64_t *duration)
 
 int legacy_player_set_display_mode(player_h player, player_display_mode_e mode)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
        LOGI("[%s] mode:%d", __FUNCTION__, mode);
 
-       int ret = mm_player_set_attribute(handle->mm_handle, NULL, "display_method", mode, (char *)NULL);
+       ret = mm_player_set_attribute(handle->mm_handle, NULL, "display_method", mode, (char *)NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_display_mode(player_h player, player_display_mode_e *mode)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(mode);
-       player_s *handle = (player_s *)player;
-       int ret = mm_player_get_attribute(handle->mm_handle, NULL, "display_method", mode, (char *)NULL);
+
+       ret = mm_player_get_attribute(handle->mm_handle, NULL, "display_method", mode, (char *)NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_playback_rate(player_h player, float rate)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        LOGI("[%s] rate : %0.1f", __FUNCTION__, rate);
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_CHECK_CONDITION(rate >= -5.0 && rate <= 5.0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-       player_s *handle = (player_s *)player;
 
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       int ret = mm_player_set_play_speed(handle->mm_handle, rate, FALSE);
-
+       ret = mm_player_set_play_speed(handle->mm_handle, rate, false);
        switch (ret) {
        case MM_ERROR_NONE:
        case MM_ERROR_PLAYER_NO_OP:
@@ -1352,84 +1344,87 @@ int legacy_player_set_playback_rate(player_h player, float rate)
        default:
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
        }
+
        return ret;
 }
 
 int legacy_player_set_display_rotation(player_h player, player_display_rotation_e rotation)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
-       int ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_VIDEO_ROTATION, rotation, (char *)NULL);
+       ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_VIDEO_ROTATION, rotation, (char *)NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_display_rotation(player_h player, player_display_rotation_e *rotation)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(rotation);
-       player_s *handle = (player_s *)player;
-       int ret = mm_player_get_attribute(handle->mm_handle, NULL, MM_PLAYER_VIDEO_ROTATION, rotation, (char *)NULL);
+
+       ret = mm_player_get_attribute(handle->mm_handle, NULL, MM_PLAYER_VIDEO_ROTATION, rotation, (char *)NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_display_visible(player_h player, bool visible)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
-
+       int ret = MM_ERROR_NONE;
        int value = 0;
-       if (visible == TRUE)
+       PLAYER_INSTANCE_CHECK(player);
+
+       if (visible)
                value = 1;
 
-       int ret = mm_player_set_attribute(handle->mm_handle, NULL, "display_visible", value, (char *)NULL);
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_set_attribute(handle->mm_handle, NULL, "display_visible", value, (char *)NULL);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               handle->is_display_visible = visible;
-               return PLAYER_ERROR_NONE;
-       }
+
+       handle->is_display_visible = visible;
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_is_display_visible(player_h player, bool *visible)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       int value;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(visible);
-       player_s *handle = (player_s *)player;
-       int count;
-       int ret = mm_player_get_attribute(handle->mm_handle, NULL, "display_visible", &count, (char *)NULL);
-       if (ret != MM_ERROR_NONE) {
+
+       ret = mm_player_get_attribute(handle->mm_handle, NULL, "display_visible", &value, (char *)NULL);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               if (count == 0)
-                       *visible = FALSE;
-               else
-                       *visible = TRUE;
 
-               return PLAYER_ERROR_NONE;
-       }
+       *visible = (value == 0) ? false : true;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_content_info(player_h player, player_content_info_e key, char **value)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       char *attr = NULL;
+       char *val = NULL;
+       int val_len = 0;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(value);
-       player_s *handle = (player_s *)player;
+
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE (0x%08x) :  current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       char *attr = NULL;
-       char *val = NULL;
-       int val_len = 0;
-
        switch (key) {
        case PLAYER_CONTENT_INFO_ALBUM:
                attr = MM_PLAYER_TAG_ALBUM;
@@ -1453,73 +1448,75 @@ int legacy_player_get_content_info(player_h player, player_content_info_e key, c
                attr = NULL;
        }
 
-       int ret = mm_player_get_attribute(handle->mm_handle, NULL, attr, &val, &val_len, (char *)NULL);
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_get_attribute(handle->mm_handle, NULL, attr, &val, &val_len, (char *)NULL);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               *value = NULL;
-               if (val != NULL)
-                       *value = strndup(val, val_len);
-               else
-                       *value = strndup("", 0);
 
-               if (*value == NULL) {
-                       LOGE("[%s] PLAYER_ERROR_OUT_OF_MEMORY(0x%08x) : fail to strdup ", __FUNCTION__, PLAYER_ERROR_OUT_OF_MEMORY);
-                       return PLAYER_ERROR_OUT_OF_MEMORY;
-               }
-               return PLAYER_ERROR_NONE;
+       *value = NULL;
+       if (val != NULL)
+               *value = strndup(val, val_len);
+       else
+               *value = strndup("", 0);
+
+       if (*value == NULL) {
+               LOGE("[%s] PLAYER_ERROR_OUT_OF_MEMORY(0x%08x) : fail to strdup ", __FUNCTION__, PLAYER_ERROR_OUT_OF_MEMORY);
+               return PLAYER_ERROR_OUT_OF_MEMORY;
        }
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_codec_info(player_h player, char **audio_codec, char **video_codec)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       char *audio = NULL;
+       int audio_len = 0;
+       char *video = NULL;
+       int video_len = 0;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(audio_codec);
        PLAYER_NULL_ARG_CHECK(video_codec);
-       player_s *handle = (player_s *)player;
+
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE (0x%08x) :  current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       char *audio = NULL;
-       int audio_len = 0;
-       char *video = NULL;
-       int video_len = 0;
-
-       int ret = mm_player_get_attribute(handle->mm_handle, NULL, MM_PLAYER_AUDIO_CODEC, &audio, &audio_len, MM_PLAYER_VIDEO_CODEC, &video, &video_len, (char *)NULL);
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_get_attribute(handle->mm_handle, NULL, MM_PLAYER_AUDIO_CODEC, &audio, &audio_len, MM_PLAYER_VIDEO_CODEC, &video, &video_len, (char *)NULL);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               *audio_codec = NULL;
-               if (audio != NULL)
-                       *audio_codec = strndup(audio, audio_len);
-               else
-                       *audio_codec = strndup("", 0);
 
-               *video_codec = NULL;
-               if (video != NULL)
-                       *video_codec = strndup(video, video_len);
-               else
-                       *video_codec = strndup("", 0);
+       *audio_codec = NULL;
+       if (audio != NULL)
+               *audio_codec = strndup(audio, audio_len);
+       else
+               *audio_codec = strndup("", 0);
 
-               LOGD("codec info: %s, %s", *audio_codec, *video_codec);
-               return PLAYER_ERROR_NONE;
-       }
+       *video_codec = NULL;
+       if (video != NULL)
+               *video_codec = strndup(video, video_len);
+       else
+               *video_codec = strndup("", 0);
+
+       LOGD("codec info: %s, %s", *audio_codec, *video_codec);
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_audio_stream_info(player_h player, int *sample_rate, int *channel, int *bit_rate)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(sample_rate);
        PLAYER_NULL_ARG_CHECK(channel);
        PLAYER_NULL_ARG_CHECK(bit_rate);
-       player_s *handle = (player_s *)player;
+
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE (0x%08x) :  current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
-       int ret = mm_player_get_attribute(handle->mm_handle, NULL, MM_PLAYER_AUDIO_SAMPLERATE, sample_rate, MM_PLAYER_AUDIO_CHANNEL, channel, MM_PLAYER_AUDIO_BITRATE, bit_rate, (char *)NULL);
+       ret = mm_player_get_attribute(handle->mm_handle, NULL, MM_PLAYER_AUDIO_SAMPLERATE, sample_rate, MM_PLAYER_AUDIO_CHANNEL, channel, MM_PLAYER_AUDIO_BITRATE, bit_rate, (char *)NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
 
@@ -1528,15 +1525,17 @@ int legacy_player_get_audio_stream_info(player_h player, int *sample_rate, int *
 
 int legacy_player_get_video_stream_info(player_h player, int *fps, int *bit_rate)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(fps);
        PLAYER_NULL_ARG_CHECK(bit_rate);
-       player_s *handle = (player_s *)player;
+
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE (0x%08x) :  current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
-       int ret = mm_player_get_attribute(handle->mm_handle, NULL, "content_video_fps", fps, "content_video_bitrate", bit_rate, (char *)NULL);
+       ret = mm_player_get_attribute(handle->mm_handle, NULL, "content_video_fps", fps, "content_video_bitrate", bit_rate, (char *)NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
 
@@ -1545,38 +1544,39 @@ int legacy_player_get_video_stream_info(player_h player, int *fps, int *bit_rate
 
 int legacy_player_get_video_size(player_h player, int *width, int *height)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       int w;
+       int h;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(width);
        PLAYER_NULL_ARG_CHECK(height);
-       player_s *handle = (player_s *)player;
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE (0x%08x) :  current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
-       int w;
-       int h;
-       int ret = mm_player_get_attribute(handle->mm_handle, NULL, MM_PLAYER_VIDEO_WIDTH, &w, MM_PLAYER_VIDEO_HEIGHT, &h, (char *)NULL);
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_get_attribute(handle->mm_handle, NULL, MM_PLAYER_VIDEO_WIDTH, &w, MM_PLAYER_VIDEO_HEIGHT, &h, (char *)NULL);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               *width = w;
-               *height = h;
-               LOGI("[%s] width : %d, height : %d", __FUNCTION__, w, h);
-               return PLAYER_ERROR_NONE;
-       }
+
+       *width = w;
+       *height = h;
+       LOGI("[%s] width : %d, height : %d", __FUNCTION__, w, h);
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_album_art(player_h player, void **album_art, int *size)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(size);
-       player_s *handle = (player_s *)player;
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE (0x%08x) :  current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       int ret = mm_player_get_attribute(handle->mm_handle, NULL, "tag_album_cover", album_art, size, (char *)NULL);
+       ret = mm_player_get_attribute(handle->mm_handle, NULL, "tag_album_cover", album_art, size, (char *)NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
 
@@ -1585,181 +1585,195 @@ int legacy_player_get_album_art(player_h player, void **album_art, int *size)
 
 int legacy_player_audio_effect_get_equalizer_bands_count(player_h player, int *count)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(count);
-       player_s *handle = (player_s *)player;
 
-       int ret = mm_player_audio_effect_custom_get_eq_bands_number(handle->mm_handle, count);
+       ret = mm_player_audio_effect_custom_get_eq_bands_number(handle->mm_handle, count);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_audio_effect_set_equalizer_all_bands(player_h player, int *band_levels, int length)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(band_levels);
-       player_s *handle = (player_s *)player;
 
-       int ret = mm_player_audio_effect_custom_set_level_eq_from_list(handle->mm_handle, band_levels, length);
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_audio_effect_custom_set_level_eq_from_list(handle->mm_handle, band_levels, length);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               ret = mm_player_audio_effect_custom_apply(handle->mm_handle);
-               return (ret == MM_ERROR_NONE) ? PLAYER_ERROR_NONE : __player_convert_error_code(ret, (char *)__FUNCTION__);
-       }
+
+       ret = mm_player_audio_effect_custom_apply(handle->mm_handle);
+       return (ret == MM_ERROR_NONE) ? PLAYER_ERROR_NONE : __player_convert_error_code(ret, (char *)__FUNCTION__);
 }
 
 int legacy_player_audio_effect_set_equalizer_band_level(player_h player, int index, int level)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
-       int ret = mm_player_audio_effect_custom_set_level(handle->mm_handle, MM_AUDIO_EFFECT_CUSTOM_EQ, index, level);
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_audio_effect_custom_set_level(handle->mm_handle, MM_AUDIO_EFFECT_CUSTOM_EQ, index, level);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               ret = mm_player_audio_effect_custom_apply(handle->mm_handle);
-               return (ret == MM_ERROR_NONE) ? PLAYER_ERROR_NONE : __player_convert_error_code(ret, (char *)__FUNCTION__);
-       }
+
+       ret = mm_player_audio_effect_custom_apply(handle->mm_handle);
+       if (ret != MM_ERROR_NONE)
+               return __player_convert_error_code(ret, (char *)__FUNCTION__);
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_audio_effect_get_equalizer_band_level(player_h player, int index, int *level)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(level);
-       player_s *handle = (player_s *)player;
 
-       int ret = mm_player_audio_effect_custom_get_level(handle->mm_handle, MM_AUDIO_EFFECT_CUSTOM_EQ, index, level);
+       ret = mm_player_audio_effect_custom_get_level(handle->mm_handle, MM_AUDIO_EFFECT_CUSTOM_EQ, index, level);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_audio_effect_get_equalizer_level_range(player_h player, int *min, int *max)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(min);
        PLAYER_NULL_ARG_CHECK(max);
-       player_s *handle = (player_s *)player;
 
-       int ret = mm_player_audio_effect_custom_get_level_range(handle->mm_handle, MM_AUDIO_EFFECT_CUSTOM_EQ, min, max);
+       ret = mm_player_audio_effect_custom_get_level_range(handle->mm_handle, MM_AUDIO_EFFECT_CUSTOM_EQ, min, max);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_audio_effect_get_equalizer_band_frequency(player_h player, int index, int *frequency)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(frequency);
-       player_s *handle = (player_s *)player;
 
-       int ret = mm_player_audio_effect_custom_get_eq_bands_freq(handle->mm_handle, index, frequency);
+       ret = mm_player_audio_effect_custom_get_eq_bands_freq(handle->mm_handle, index, frequency);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_audio_effect_get_equalizer_band_frequency_range(player_h player, int index, int *range)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(range);
-       player_s *handle = (player_s *)player;
 
-       int ret = mm_player_audio_effect_custom_get_eq_bands_width(handle->mm_handle, index, range);
+       ret = mm_player_audio_effect_custom_get_eq_bands_width(handle->mm_handle, index, range);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_audio_effect_equalizer_clear(player_h player)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
-       int ret = mm_player_audio_effect_custom_clear_eq_all(handle->mm_handle);
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_audio_effect_custom_clear_eq_all(handle->mm_handle);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               ret = mm_player_audio_effect_custom_apply(handle->mm_handle);
-               return (ret == MM_ERROR_NONE) ? PLAYER_ERROR_NONE : __player_convert_error_code(ret, (char *)__FUNCTION__);
-       }
+
+       ret = mm_player_audio_effect_custom_apply(handle->mm_handle);
+       if (ret != MM_ERROR_NONE)
+               return __player_convert_error_code(ret, (char *)__FUNCTION__);
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_audio_effect_equalizer_is_available(player_h player, bool *available)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(available);
-
-       player_s *handle = (player_s *)player;
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       int ret = mm_player_is_supported_custom_effect_type(handle->mm_handle, MM_AUDIO_EFFECT_CUSTOM_EQ);
+       ret = mm_player_is_supported_custom_effect_type(handle->mm_handle, MM_AUDIO_EFFECT_CUSTOM_EQ);
        if (ret != MM_ERROR_NONE)
-               *available = FALSE;
+               *available = false;
        else
-               *available = TRUE;
+               *available = true;
+
        return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_subtitle_path(player_h player, const char *path)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
        if ((path == NULL) && (handle->state != PLAYER_STATE_IDLE))
                return PLAYER_ERROR_INVALID_PARAMETER;
 
-       int ret = mm_player_set_external_subtitle_path(handle->mm_handle, path);
+       ret = mm_player_set_external_subtitle_path(handle->mm_handle, path);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_subtitle_position_offset(player_h player, int millisecond)
 {
-       PLAYER_INSTANCE_CHECK(player);
        /* PLAYER_CHECK_CONDITION(millisecond>=0  ,PLAYER_ERROR_INVALID_PARAMETER ,"PLAYER_ERROR_INVALID_PARAMETER" ); */
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
        if (!__player_state_validate(handle, PLAYER_STATE_PLAYING)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       int ret = mm_player_adjust_subtitle_position(handle->mm_handle, MM_PLAYER_POS_FORMAT_TIME, millisecond);
+       ret = mm_player_adjust_subtitle_position(handle->mm_handle, MM_PLAYER_POS_FORMAT_TIME, millisecond);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_capture_video(player_h player, player_video_captured_cb callback, void *user_data)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(callback);
-
-       player_s *handle = (player_s *)player;
        if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_CAPTURE]) {
                LOGE("[%s] PLAYER_ERROR_VIDEO_CAPTURE_FAILED (0x%08x) : capturing... we can't do any more ", __FUNCTION__, PLAYER_ERROR_VIDEO_CAPTURE_FAILED);
                return PLAYER_ERROR_VIDEO_CAPTURE_FAILED;
-       } else {
-               LOGI("[%s] Event type : %d ", __FUNCTION__, MUSE_PLAYER_EVENT_TYPE_CAPTURE);
-               handle->user_cb[MUSE_PLAYER_EVENT_TYPE_CAPTURE] = callback;
-               handle->user_data[MUSE_PLAYER_EVENT_TYPE_CAPTURE] = user_data;
        }
 
+       LOGI("[%s] Event type : %d ", __FUNCTION__, MUSE_PLAYER_EVENT_TYPE_CAPTURE);
+       handle->user_cb[MUSE_PLAYER_EVENT_TYPE_CAPTURE] = callback;
+       handle->user_data[MUSE_PLAYER_EVENT_TYPE_CAPTURE] = user_data;
+
        if (handle->state >= PLAYER_STATE_READY) {
-               int ret = mm_player_do_video_capture(handle->mm_handle);
+               ret = mm_player_do_video_capture(handle->mm_handle);
                if (ret == MM_ERROR_PLAYER_NO_OP) {
                        handle->user_cb[MUSE_PLAYER_EVENT_TYPE_CAPTURE] = NULL;
                        handle->user_data[MUSE_PLAYER_EVENT_TYPE_CAPTURE] = NULL;
@@ -1770,54 +1784,54 @@ int legacy_player_capture_video(player_h player, player_video_captured_cb callba
                        handle->user_cb[MUSE_PLAYER_EVENT_TYPE_CAPTURE] = NULL;
                        handle->user_data[MUSE_PLAYER_EVENT_TYPE_CAPTURE] = NULL;
                        return __player_convert_error_code(ret, (char *)__FUNCTION__);
-               } else
-                       return PLAYER_ERROR_NONE;
-       } else {
-               LOGE("[%s] PLAYER_ERROR_INVALID_STATE (0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
-               handle->user_cb[MUSE_PLAYER_EVENT_TYPE_CAPTURE] = NULL;
-               handle->user_data[MUSE_PLAYER_EVENT_TYPE_CAPTURE] = NULL;
-               return PLAYER_ERROR_INVALID_STATE;
+               }
+               return PLAYER_ERROR_NONE;
        }
+
+       LOGE("[%s] PLAYER_ERROR_INVALID_STATE (0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
+       handle->user_cb[MUSE_PLAYER_EVENT_TYPE_CAPTURE] = NULL;
+       handle->user_data[MUSE_PLAYER_EVENT_TYPE_CAPTURE] = NULL;
+       return PLAYER_ERROR_INVALID_STATE;
 }
 
 int legacy_player_set_streaming_cookie(player_h player, const char *cookie, int size)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(cookie);
        PLAYER_CHECK_CONDITION(size >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-       player_s *handle = (player_s *)player;
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
 
-       int ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_STREAMING_COOKIE, cookie, size, (char *)NULL);
+       ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_STREAMING_COOKIE, cookie, size, (char *)NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_streaming_user_agent(player_h player, const char *user_agent, int size)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(user_agent);
        PLAYER_CHECK_CONDITION(size >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-       player_s *handle = (player_s *)player;
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
 
-       int ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_STREAMING_USER_AGENT, user_agent, size, (char *)NULL);
+       ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_STREAMING_USER_AGENT, user_agent, size, (char *)NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_streaming_download_progress(player_h player, int *start_pos, int *end_pos)
 {
-       int ret = MM_ERROR_NONE;
        player_s *handle = (player_s *)player;
-
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(start_pos && end_pos);
-
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("invalid state error, current state - %d", handle->state);
                return PLAYER_ERROR_INVALID_STATE;
@@ -1892,10 +1906,10 @@ int legacy_player_unset_subtitle_updated_cb(player_h player)
        return __unset_callback(MUSE_PLAYER_EVENT_TYPE_SUBTITLE, player);
 }
 
-int legacy_player_release_video_stream_bo(player_h player, voidbo)
+int legacy_player_release_video_stream_bo(player_h player, void *bo)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       PLAYER_INSTANCE_CHECK(player);
 
        LOGD("ENTER %p %p", player, bo);
 
@@ -1908,12 +1922,13 @@ int legacy_player_release_video_stream_bo(player_h player, void* bo)
 
 int legacy_player_set_media_packet_video_frame_decoded_cb(player_h player, legacy_player_media_packet_video_decoded_cb callback, void *user_data)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(callback);
-       player_s *handle = (player_s *)player;
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
 
-       int ret = mm_player_set_video_stream_callback(handle->mm_handle, (mm_player_video_stream_callback)callback, user_data);
+       ret = mm_player_set_video_stream_callback(handle->mm_handle, (mm_player_video_stream_callback)callback, user_data);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
 
@@ -1923,13 +1938,14 @@ int legacy_player_set_media_packet_video_frame_decoded_cb(player_h player, legac
 static bool __video_stream_changed_callback(void *user_data)
 {
        player_s *handle = (player_s *)user_data;
+       int ret = MM_ERROR_NONE;
        muse_player_event_e event_type = MUSE_PLAYER_EVENT_TYPE_VIDEO_STREAM_CHANGED;
 
        LOGE("[%s] event type %d", __FUNCTION__, event_type);
 
        if (handle->user_cb[event_type]) {
                int width = 0, height = 0, fps = 0, bit_rate = 0;
-               int ret = mm_player_get_attribute(handle->mm_handle, NULL,
+               ret = mm_player_get_attribute(handle->mm_handle, NULL,
                                                                                  MM_PLAYER_VIDEO_WIDTH, &width,
                                                                                  MM_PLAYER_VIDEO_HEIGHT, &height,
                                                                                  "content_video_fps", &fps,
@@ -1937,28 +1953,25 @@ static bool __video_stream_changed_callback(void *user_data)
 
                if (ret != MM_ERROR_NONE) {
                        LOGE("[%s] get attr is failed", __FUNCTION__);
-                       return FALSE;
+                       return false;
                }
-
                ((player_video_stream_changed_cb)handle->user_cb[event_type])(width, height, fps, bit_rate, handle->user_data[event_type]);
-       } else {
-               LOGE("[%s] video stream changed cb was not set.", __FUNCTION__);
-               return FALSE;
+               return true;
        }
 
-       return TRUE;
+       LOGE("[%s] video stream changed cb was not set.", __FUNCTION__);
+       return false;
 }
 
 int legacy_player_set_video_stream_changed_cb(player_h player, player_video_stream_changed_cb callback, void *user_data)
 {
-       int ret;
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(callback);
-       player_s *handle = (player_s *)player;
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
 
        ret = mm_player_set_video_stream_changed_callback(handle->mm_handle, (mm_player_stream_changed_callback)__video_stream_changed_callback, (void *)handle);
-
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
 
@@ -1984,7 +1997,7 @@ static bool __media_stream_buffer_status_callback(player_stream_type_e type, pla
        else if (type == PLAYER_STREAM_TYPE_VIDEO)
                event_type = MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS;
        else
-               return FALSE;
+               return false;
 
        LOGE("[%s] event type %d", __FUNCTION__, event_type);
 
@@ -1992,10 +2005,10 @@ static bool __media_stream_buffer_status_callback(player_stream_type_e type, pla
                ((player_media_stream_buffer_status_cb)handle->user_cb[event_type])(status, handle->user_data[event_type]);
        } else {
                LOGE("[%s][type:%d] buffer status cb was not set.", __FUNCTION__, type);
-               return FALSE;
+               return false;
        }
 
-       return TRUE;
+       return true;
 }
 
 static bool __media_stream_seek_data_callback(player_stream_type_e type, unsigned long long offset, void *user_data)
@@ -2008,7 +2021,7 @@ static bool __media_stream_seek_data_callback(player_stream_type_e type, unsigne
        else if (type == PLAYER_STREAM_TYPE_VIDEO)
                event_type = MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_SEEK;
        else
-               return FALSE;
+               return false;
 
        LOGE("[%s] event type %d", __FUNCTION__, event_type);
 
@@ -2016,18 +2029,18 @@ static bool __media_stream_seek_data_callback(player_stream_type_e type, unsigne
                ((player_media_stream_seek_cb)handle->user_cb[event_type])(offset, handle->user_data[event_type]);
        } else {
                LOGE("[%s][type:%d] seek cb was not set.", __FUNCTION__, type);
-               return FALSE;
+               return false;
        }
 
-       return TRUE;
+       return true;
 }
 
 int legacy_player_set_media_stream_buffer_status_cb(player_h player, player_stream_type_e type, player_media_stream_buffer_status_cb callback, void *user_data)
 {
-       int ret;
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(callback);
-       player_s *handle = (player_s *)player;
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
 
        /* the type can be expaned with default and text. */
@@ -2063,10 +2076,10 @@ int legacy_player_unset_media_stream_buffer_status_cb(player_h player, player_st
 
 int legacy_player_set_media_stream_seek_cb(player_h player, player_stream_type_e type, player_media_stream_seek_cb callback, void *user_data)
 {
-       int ret;
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(callback);
-       player_s *handle = (player_s *)player;
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
 
        /* the type can be expaned with default and text. */
@@ -2076,14 +2089,13 @@ int legacy_player_set_media_stream_seek_cb(player_h player, player_stream_type_e
        }
 
        ret = mm_player_set_media_stream_seek_data_callback(handle->mm_handle, type, (mm_player_media_stream_seek_data_callback)__media_stream_seek_data_callback, (void *)handle);
-
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
 
        if (type == PLAYER_STREAM_TYPE_VIDEO)
                return __set_callback(MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_SEEK, player, callback, user_data);
-       else
-               return __set_callback(MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK, player, callback, user_data);
+
+       return __set_callback(MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_AUDIO_SEEK, player, callback, user_data);
 }
 
 int legacy_player_unset_media_stream_seek_cb(player_h player, player_stream_type_e type)
@@ -2102,27 +2114,27 @@ int legacy_player_unset_media_stream_seek_cb(player_h player, player_stream_type
 
 int legacy_player_push_media_stream(player_h player, media_packet_h packet)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
        PLAYER_CHECK_CONDITION(handle->error_code == PLAYER_ERROR_NONE, PLAYER_ERROR_NOT_SUPPORTED_FILE, "can't support this format");
 
-       int ret = mm_player_submit_packet(handle->mm_handle, packet);
-
+       ret = mm_player_submit_packet(handle->mm_handle, packet);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_media_stream_info(player_h player, player_stream_type_e type, media_format_h format)
 {
-       int ret;
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
 
-       handle->is_media_stream = TRUE;
+       handle->is_media_stream = true;
 
        if (type == PLAYER_STREAM_TYPE_VIDEO)
                ret = mm_player_set_video_info(handle->mm_handle, format);
@@ -2133,92 +2145,89 @@ int legacy_player_set_media_stream_info(player_h player, player_stream_type_e ty
 
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
 
        return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_media_stream_buffer_max_size(player_h player, player_stream_type_e type, unsigned long long max_size)
 {
-       int ret;
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
        ret = mm_player_set_media_stream_buffer_max_size(handle->mm_handle, type, max_size);
-
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_media_stream_buffer_max_size(player_h player, player_stream_type_e type, unsigned long long *max_size)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       unsigned long long _max_size;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(max_size);
-       player_s *handle = (player_s *)player;
 
-       unsigned long long _max_size;
-       int ret = mm_player_get_media_stream_buffer_max_size(handle->mm_handle, type, &_max_size);
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_get_media_stream_buffer_max_size(handle->mm_handle, type, &_max_size);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               *max_size = _max_size;
-               return PLAYER_ERROR_NONE;
-       }
+
+       *max_size = _max_size;
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_media_stream_buffer_min_threshold(player_h player, player_stream_type_e type, unsigned int percent)
 {
-       int ret;
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
        ret = mm_player_set_media_stream_buffer_min_percent(handle->mm_handle, type, percent);
-
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_media_stream_buffer_min_threshold(player_h player, player_stream_type_e type, unsigned int *percent)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       unsigned int _value;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(percent);
-       player_s *handle = (player_s *)player;
 
-       unsigned int _value;
-       int ret = mm_player_get_media_stream_buffer_min_percent(handle->mm_handle, type, &_value);
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_get_media_stream_buffer_min_percent(handle->mm_handle, type, &_value);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               *percent = _value;
-               return PLAYER_ERROR_NONE;
-       }
+
+       *percent = _value;
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_track_count(player_h player, player_stream_type_e type, int *count)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       MMPlayerTrackType track_type = 0;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(count);
-       player_s *handle = (player_s *)player;
 
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE (0x%08x) :  current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       MMPlayerTrackType track_type = 0;
        switch (type) {
        case PLAYER_STREAM_TYPE_AUDIO:
                track_type = MM_PLAYER_TRACK_TYPE_AUDIO;
@@ -2231,7 +2240,7 @@ int legacy_player_get_track_count(player_h player, player_stream_type_e type, in
                return PLAYER_ERROR_INVALID_PARAMETER;
        }
 
-       int ret = mm_player_get_track_count(handle->mm_handle, track_type, count);
+       ret = mm_player_get_track_count(handle->mm_handle, track_type, count);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
 
@@ -2240,16 +2249,16 @@ int legacy_player_get_track_count(player_h player, player_stream_type_e type, in
 
 int legacy_player_get_current_track(player_h player, player_stream_type_e type, int *index)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       MMPlayerTrackType track_type = 0;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(index);
-       player_s *handle = (player_s *)player;
-
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE (0x%08x) :  current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       MMPlayerTrackType track_type = 0;
        switch (type) {
        case PLAYER_STREAM_TYPE_AUDIO:
                track_type = MM_PLAYER_TRACK_TYPE_AUDIO;
@@ -2262,7 +2271,7 @@ int legacy_player_get_current_track(player_h player, player_stream_type_e type,
                return PLAYER_ERROR_INVALID_PARAMETER;
        }
 
-       int ret = mm_player_get_current_track(handle->mm_handle, track_type, index);
+       ret = mm_player_get_current_track(handle->mm_handle, track_type, index);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
 
@@ -2271,16 +2280,16 @@ int legacy_player_get_current_track(player_h player, player_stream_type_e type,
 
 int legacy_player_select_track(player_h player, player_stream_type_e type, int index)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       MMPlayerTrackType track_type = 0;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_CHECK_CONDITION(index >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-       player_s *handle = (player_s *)player;
-
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE (0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       MMPlayerTrackType track_type = 0;
        switch (type) {
        case PLAYER_STREAM_TYPE_AUDIO:
                track_type = MM_PLAYER_TRACK_TYPE_AUDIO;
@@ -2293,7 +2302,7 @@ int legacy_player_select_track(player_h player, player_stream_type_e type, int i
                return PLAYER_ERROR_INVALID_PARAMETER;
        }
 
-       int ret = mm_player_select_track(handle->mm_handle, track_type, index);
+       ret = mm_player_select_track(handle->mm_handle, track_type, index);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
 
@@ -2302,16 +2311,17 @@ int legacy_player_select_track(player_h player, player_stream_type_e type, int i
 
 int legacy_player_get_track_language_code(player_h player, player_stream_type_e type, int index, char **code, int *len)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       MMPlayerTrackType track_type = 0;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(code);
        PLAYER_NULL_ARG_CHECK(len);
-       player_s *handle = (player_s *)player;
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE (0x%08x) :  current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       MMPlayerTrackType track_type = 0;
        switch (type) {
        case PLAYER_STREAM_TYPE_AUDIO:
                track_type = MM_PLAYER_TRACK_TYPE_AUDIO;
@@ -2328,11 +2338,9 @@ int legacy_player_get_track_language_code(player_h player, player_stream_type_e
        }
 
        *code = NULL;
-       int ret = mm_player_get_track_language_code(handle->mm_handle, track_type, index, code);
-
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_get_track_language_code(handle->mm_handle, track_type, index, code);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       }
 
        LOGD("idx %d, lang code %s", index, *code);
        *len = strlen(*code);
@@ -2342,9 +2350,9 @@ int legacy_player_get_track_language_code(player_h player, player_stream_type_e
 int legacy_player_set_video_roi_area(player_h player, double scale_x,
                double scale_y, double scale_width, double scale_heights)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
-       int ret;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
        LOGD("<Enter>");
 
@@ -2356,35 +2364,35 @@ int legacy_player_set_video_roi_area(player_h player, double scale_x,
        ret = mm_player_set_video_roi_area(handle->mm_handle, scale_x, scale_y, scale_width, scale_heights);
        if (ret != PLAYER_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_video_roi_area(player_h player, double *scale_x,
                double *scale_y, double *scale_width, double *scale_height)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(scale_x);
        PLAYER_NULL_ARG_CHECK(scale_y);
        PLAYER_NULL_ARG_CHECK(scale_width);
        PLAYER_NULL_ARG_CHECK(scale_height);
-       player_s *handle = (player_s *)player;
-       int ret;
 
        LOGD("<Enter>");
 
        ret = mm_player_get_video_roi_area(handle->mm_handle, scale_x, scale_y, scale_width, scale_height);
        if (ret != PLAYER_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_roi_area(player_h player, int x, int y, int w, int h)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
-       int ret;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
        LOGD("<Enter>");
 
@@ -2392,19 +2400,18 @@ int legacy_player_set_roi_area(player_h player, int x, int y, int w, int h)
        ret = mm_player_set_attribute(handle->mm_handle, NULL, "display_win_roi_x", x, "display_win_roi_y", y, "display_win_roi_width", w, "display_win_roi_height", h, (char *)NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_display(player_h player, player_display_type_e type, unsigned int wl_surface_id)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        void *set_handle = NULL;
-       MMDisplaySurfaceType mmType = __player_convert_display_type(type);
-       int ret;
        void *temp = NULL;
-
+       MMDisplaySurfaceType mmType = __player_convert_display_type(type);
+       PLAYER_INSTANCE_CHECK(player);
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
@@ -2471,36 +2478,35 @@ int legacy_player_set_display(player_h player, player_display_type_e type, unsig
        if (ret != MM_ERROR_NONE) {
                handle->display_type = PLAYER_DISPLAY_TYPE_NONE;
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               return PLAYER_ERROR_NONE;
        }
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_sound_stream_info_for_mused(player_h player, char *stream_type, int stream_index)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
-       int ret;
-
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
+
        if (stream_type == NULL || stream_index < 0) {
                LOGE("invalid parameter %p %d", stream_type, stream_index);
                return PLAYER_ERROR_INVALID_PARAMETER;
        }
 
        ret = mm_player_set_sound_stream_info(handle->mm_handle, stream_type, stream_index);
-
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_timeout_for_muse(player_h player, int *timeout)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
-       int ret;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
        ret = mm_player_get_timeout(handle->mm_handle, timeout);
        if (ret != MM_ERROR_NONE)
@@ -2511,12 +2517,13 @@ int legacy_player_get_timeout_for_muse(player_h player, int *timeout)
 
 int legacy_player_get_num_of_video_out_buffers(player_h player, int *num, int *extra_num)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(num);
        PLAYER_NULL_ARG_CHECK(extra_num);
-       player_s *handle = (player_s *)player;
 
-       int ret = mm_player_get_num_of_video_out_buffers(handle->mm_handle, num, extra_num);
+       ret = mm_player_get_num_of_video_out_buffers(handle->mm_handle, num, extra_num);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
 
@@ -2525,40 +2532,39 @@ int legacy_player_get_num_of_video_out_buffers(player_h player, int *num, int *e
 
 int legacy_player_set_file_buffering_path(player_h player, const char *file_path)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(file_path);
-       player_s *handle = (player_s *)player;
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
 
-       int ret = mm_player_set_file_buffering_path(handle->mm_handle, file_path);
-
+       ret = mm_player_set_file_buffering_path(handle->mm_handle, file_path);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_manage_external_storage_state(player_h player, int id, int state)
 {
-       int ret = PLAYER_ERROR_NONE;
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
        ret = mm_player_manage_external_storage_state(handle->mm_handle, id, state);
-
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_adaptive_variant_info(player_h player, int *num, char **var_info)
 {
-       int ret = PLAYER_ERROR_NONE;
+       int ret = MM_ERROR_NONE;
+       player_s *handle = (player_s *)player;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(num);
        PLAYER_NULL_ARG_CHECK(var_info);
-       player_s *handle = (player_s *)player;
 
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
@@ -2566,7 +2572,6 @@ int legacy_player_get_adaptive_variant_info(player_h player, int *num, char **va
        }
 
        ret = mm_player_get_adaptive_variant_info(handle->mm_handle, num, var_info);
-
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
 
@@ -2575,12 +2580,11 @@ int legacy_player_get_adaptive_variant_info(player_h player, int *num, char **va
 
 int legacy_player_set_max_adaptive_variant_limit(player_h player, int bandwidth, int width, int height)
 {
-       int ret;
-       PLAYER_INSTANCE_CHECK(player);
+       int ret = MM_ERROR_NONE;
        player_s *handle = (player_s *)player;
+       PLAYER_INSTANCE_CHECK(player);
 
        ret = mm_player_set_max_adaptive_variant_limit(handle->mm_handle, bandwidth, width, height);
-
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
 
@@ -2589,14 +2593,14 @@ int legacy_player_set_max_adaptive_variant_limit(player_h player, int bandwidth,
 
 int legacy_player_get_max_adaptive_variant_limit(player_h player, int *bandwidth, int *width, int *height)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(bandwidth);
        PLAYER_NULL_ARG_CHECK(width);
        PLAYER_NULL_ARG_CHECK(height);
-       player_s *handle = (player_s *)player;
-
-       int ret = mm_player_get_max_adaptive_variant_limit(handle->mm_handle, bandwidth, width, height);
 
+       ret = mm_player_get_max_adaptive_variant_limit(handle->mm_handle, bandwidth, width, height);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
 
@@ -2605,135 +2609,132 @@ int legacy_player_get_max_adaptive_variant_limit(player_h player, int *bandwidth
 
 int legacy_player_set_audio_only(player_h player, bool audio_only)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE (0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       int ret = mm_player_set_audio_only(handle->mm_handle, audio_only);
+       ret = mm_player_set_audio_only(handle->mm_handle, audio_only);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_is_audio_only(player_h player, bool *paudio_only)
 {
-       PLAYER_INSTANCE_CHECK(player);
-       PLAYER_NULL_ARG_CHECK(paudio_only);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        bool audio_only = false;
+       PLAYER_INSTANCE_CHECK(player);
+       PLAYER_NULL_ARG_CHECK(paudio_only);
 
-       int ret = mm_player_get_audio_only(handle->mm_handle, &audio_only);
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_get_audio_only(handle->mm_handle, &audio_only);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               *paudio_only = audio_only;
-               return PLAYER_ERROR_NONE;
-       }
+
+       *paudio_only = audio_only;
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_streaming_buffering_time(player_h player, int buffer_ms, int rebuffer_ms)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
        int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
 
        ret = mm_player_set_streaming_buffering_time(handle->mm_handle, buffer_ms, rebuffer_ms);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_streaming_buffering_time(player_h player, int *buffer_ms, int *rebuffer_ms)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(buffer_ms);
        PLAYER_NULL_ARG_CHECK(rebuffer_ms);
 
-       player_s *handle = (player_s *)player;
-       int ret = MM_ERROR_NONE;
-
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE (0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
        ret = mm_player_get_streaming_buffering_time(handle->mm_handle, buffer_ms, rebuffer_ms);
-       if (ret != MM_ERROR_NONE) {
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               return PLAYER_ERROR_NONE;
-       }
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_360_is_content_spherical(player_h player, bool *is_spherical)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(is_spherical);
 
-       player_s *handle = (player_s *)player;
-
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("PLAYER_ERROR_INVALID_STATE (0x%08x) : current state - %d", PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       int ret = mm_player_360_is_content_spherical(handle->mm_handle, is_spherical);
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_360_is_content_spherical(handle->mm_handle, is_spherical);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               return PLAYER_ERROR_NONE;
-       }
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_360_set_enabled(player_h player, bool enabled)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("PLAYER_ERROR_INVALID_STATE (0x%08x) : current state - %d", PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       int ret = mm_player_360_set_enabled(handle->mm_handle, enabled);
+       ret = mm_player_360_set_enabled(handle->mm_handle, enabled);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_360_is_enabled(player_h player, bool *enabled)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(enabled);
-
-       player_s *handle = (player_s *)player;
-
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("PLAYER_ERROR_INVALID_STATE (0x%08x) : current state - %d", PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       int ret = mm_player_360_is_enabled(handle->mm_handle, enabled);
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_360_is_enabled(handle->mm_handle, enabled);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               return PLAYER_ERROR_NONE;
-       }
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_360_set_direction_of_view(player_h player, float yaw, float pitch)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
        int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("PLAYER_ERROR_INVALID_STATE (0x%08x) : current state - %d", PLAYER_ERROR_INVALID_STATE, handle->state);
@@ -2743,72 +2744,71 @@ int legacy_player_360_set_direction_of_view(player_h player, float yaw, float pi
        ret = mm_player_360_set_direction_of_view(handle->mm_handle, yaw, pitch);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_360_get_direction_of_view(player_h player, float *yaw, float *pitch)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(yaw);
        PLAYER_NULL_ARG_CHECK(pitch);
 
-       player_s *handle = (player_s *)player;
-       int ret = MM_ERROR_NONE;
-
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("PLAYER_ERROR_INVALID_STATE (0x%08x) : current state - %d", PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
        ret = mm_player_360_get_direction_of_view(handle->mm_handle, yaw, pitch);
-       if (ret != MM_ERROR_NONE) {
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               return PLAYER_ERROR_NONE;
-       }
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_360_set_zoom(player_h player, float level)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("PLAYER_ERROR_INVALID_STATE (0x%08x) : current state - %d", PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       int ret = mm_player_360_set_zoom(handle->mm_handle, level);
+       ret = mm_player_360_set_zoom(handle->mm_handle, level);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_360_get_zoom(player_h player, float *level)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("PLAYER_ERROR_INVALID_STATE (0x%08x) : current state - %d", PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       int ret = mm_player_360_get_zoom(handle->mm_handle, level);
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_360_get_zoom(handle->mm_handle, level);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               return PLAYER_ERROR_NONE;
-       }
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_360_set_field_of_view(player_h player, int horizontal_degrees, int vertical_degrees)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
        int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("PLAYER_ERROR_INVALID_STATE (0x%08x) : current state - %d", PLAYER_ERROR_INVALID_STATE, handle->state);
@@ -2818,38 +2818,35 @@ int legacy_player_360_set_field_of_view(player_h player, int horizontal_degrees,
        ret = mm_player_360_set_field_of_view(handle->mm_handle, horizontal_degrees, vertical_degrees);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_360_get_field_of_view(player_h player, int *horizontal_degrees, int *vertical_degrees)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(horizontal_degrees);
        PLAYER_NULL_ARG_CHECK(vertical_degrees);
 
-       player_s *handle = (player_s *)player;
-       int ret = MM_ERROR_NONE;
-
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("PLAYER_ERROR_INVALID_STATE (0x%08x) : current state - %d", PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
        ret = mm_player_360_get_field_of_view(handle->mm_handle, horizontal_degrees, vertical_degrees);
-       if (ret != MM_ERROR_NONE) {
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               return PLAYER_ERROR_NONE;
-       }
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_replaygain_enabled(player_h player, bool enabled)
 {
-       PLAYER_INSTANCE_CHECK(player);
-
        player_s *handle = (player_s *)player;
        int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("PLAYER_ERROR_INVALID_STATE (0x%08x) : current state - %d", PLAYER_ERROR_INVALID_STATE, handle->state);
@@ -2859,18 +2856,17 @@ int legacy_player_set_replaygain_enabled(player_h player, bool enabled)
        ret = mm_player_set_replaygain_enabled(handle->mm_handle, enabled);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_is_replaygain_enabled(player_h player, bool *enabled)
 {
-       PLAYER_INSTANCE_CHECK(player);
-       PLAYER_NULL_ARG_CHECK(enabled);
-
        player_s *handle = (player_s *)player;
        int ret = MM_ERROR_NONE;
        bool _enable;
+       PLAYER_INSTANCE_CHECK(player);
+       PLAYER_NULL_ARG_CHECK(enabled);
 
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("PLAYER_ERROR_INVALID_STATE (0x%08x) : current state - %d", PLAYER_ERROR_INVALID_STATE, handle->state);
@@ -2878,10 +2874,9 @@ int legacy_player_is_replaygain_enabled(player_h player, bool *enabled)
        }
 
        ret = mm_player_is_replaygain_enabled(handle->mm_handle, &_enable);
-       if (ret != MM_ERROR_NONE) {
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               *enabled = _enable;
-               return PLAYER_ERROR_NONE;
-       }
+
+       *enabled = _enable;
+       return PLAYER_ERROR_NONE;
 }
index c3d1f7e..26c3e9e 100644 (file)
@@ -1,18 +1,18 @@
 /*
-* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -29,8 +29,8 @@
 #include "legacy_player_private.h"
 
 /*
-* Internal Macros
-*/
+ * Internal Macros
+ */
 #define PLAYER_SET_CALLBACK(event_type, handle, callback, user_data) \
 do { \
        PLAYER_INSTANCE_CHECK(handle); \
@@ -51,15 +51,16 @@ bool __audio_stream_callback(MMPlayerAudioStreamDataType *stream, void *user_dat
 
        if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME])
                ((player_audio_pcm_extraction_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME])((player_audio_raw_data_s *)stream, handle->user_data[MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME]);
+
        return true;
 }
 
 int legacy_player_set_pcm_extraction_mode(player_h player, bool sync, player_audio_pcm_extraction_cb callback, void *user_data)
 {
-       PLAYER_INSTANCE_CHECK(player);
-       PLAYER_NULL_ARG_CHECK(callback);
        player_s *handle = (player_s *)player;
        int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
+       PLAYER_NULL_ARG_CHECK(callback);
 
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
 
@@ -73,10 +74,9 @@ int legacy_player_set_pcm_extraction_mode(player_h player, bool sync, player_aud
 
 int legacy_player_set_pcm_spec(player_h player, const char *format, int samplerate, int channel)
 {
-       PLAYER_INSTANCE_CHECK(player);
-
        player_s *handle = (player_s *)player;
        int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
 
        LOGD("format: %s, rate: %d, ch: %d", format, samplerate, channel);
 
@@ -103,17 +103,17 @@ int legacy_player_set_pcm_spec(player_h player, const char *format, int samplera
 
 int legacy_player_set_streaming_playback_rate(player_h player, float rate)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        LOGI("[%s] rate : %0.1f", __FUNCTION__, rate);
        PLAYER_INSTANCE_CHECK(player);
-       player_s *handle = (player_s *) player;
 
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       int ret = mm_player_set_play_speed(handle->mm_handle, rate, TRUE);
-
+       ret = mm_player_set_play_speed(handle->mm_handle, rate, true);
        switch (ret) {
        case MM_ERROR_NONE:
        case MM_ERROR_PLAYER_NO_OP:
@@ -167,11 +167,11 @@ static bool __media_stream_buffer_status_callback_ex(player_stream_type_e type,
 
 int legacy_player_set_media_stream_buffer_status_cb_ex(player_h player, player_stream_type_e type, player_media_stream_buffer_status_cb_ex callback, void *user_data)
 {
-       int ret;
-       PLAYER_INSTANCE_CHECK(player);
-       PLAYER_NULL_ARG_CHECK(callback);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        muse_player_event_e event_type;
+       PLAYER_INSTANCE_CHECK(player);
+       PLAYER_NULL_ARG_CHECK(callback);
 
        if (handle->state != PLAYER_STATE_IDLE) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
@@ -190,7 +190,6 @@ int legacy_player_set_media_stream_buffer_status_cb_ex(player_h player, player_s
 
 
        ret = mm_player_set_media_stream_buffer_status_callback(handle->mm_handle, type, (mm_player_media_stream_buffer_status_callback)__media_stream_buffer_status_callback_ex, (void *)handle);
-
        if (ret != MM_ERROR_NONE) {
                LEGACY_PLAYER_USER_CB_UNLOCK(handle, event_type);
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
@@ -209,9 +208,9 @@ int legacy_player_set_media_stream_buffer_status_cb_ex(player_h player, player_s
 
 int legacy_player_unset_media_stream_buffer_status_cb_ex(player_h player, player_stream_type_e type)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
        muse_player_event_e event_type;
+       PLAYER_INSTANCE_CHECK(player);
 
        if (type == PLAYER_STREAM_TYPE_VIDEO)
                event_type = MUSE_PLAYER_EVENT_TYPE_MEDIA_STREAM_VIDEO_BUFFER_STATUS_WITH_INFO;
@@ -234,141 +233,140 @@ int legacy_player_unset_media_stream_buffer_status_cb_ex(player_h player, player
 
 int legacy_player_set_media_stream_dynamic_resolution(player_h player, bool drc)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       PLAYER_INSTANCE_CHECK(player);
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
 
-       int ret = mm_player_set_media_stream_dynamic_resolution(handle->mm_handle, drc);
-
+       ret = mm_player_set_media_stream_dynamic_resolution(handle->mm_handle, drc);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_next_uri(player_h player, const char *uri)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
-       player_s * handle = (player_s *) player;
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       int ret = mm_player_set_next_uri(handle->mm_handle, uri);
-
+       ret = mm_player_set_next_uri(handle->mm_handle, uri);
        if (ret != MM_ERROR_NONE)
-               return __player_convert_error_code(ret, (char*)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+               return __player_convert_error_code(ret, (char *)__FUNCTION__);
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_next_uri(player_h player, char **uri)
 {
+       player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
-       player_s *handle = (player_s *) player;
 
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
 
-       int ret = mm_player_get_next_uri(handle->mm_handle, uri); /* uri will be free in muse_player.c*/
-
+       ret = mm_player_get_next_uri(handle->mm_handle, uri); /* uri will be free in muse_player.c*/
        if (ret != MM_ERROR_NONE)
-               return __player_convert_error_code(ret, (char*)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+               return __player_convert_error_code(ret, (char *)__FUNCTION__);
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_gapless(player_h player, bool gapless)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
-
+       int ret = MM_ERROR_NONE;
        int value = 0;
+       PLAYER_INSTANCE_CHECK(player);
+
        if (gapless == true)
                value = 1;
 
-       int ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_GAPLESS_MODE, value, (char *)NULL);
-
+       ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_GAPLESS_MODE, value, (char *)NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_is_gapless(player_h player, bool *gapless)
 {
-       PLAYER_INSTANCE_CHECK(player);
-       PLAYER_NULL_ARG_CHECK(gapless);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
        int value;
+       PLAYER_INSTANCE_CHECK(player);
+       PLAYER_NULL_ARG_CHECK(gapless);
 
-       int ret = mm_player_get_attribute(handle->mm_handle, NULL, MM_PLAYER_GAPLESS_MODE, &value, (char *)NULL);
-       if (ret != MM_ERROR_NONE) {
+       ret = mm_player_get_attribute(handle->mm_handle, NULL, MM_PLAYER_GAPLESS_MODE, &value, (char *)NULL);
+       if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       } else {
-               if (value == 1)
-                       *gapless = true;
-               else
-                       *gapless = false;
 
-               return PLAYER_ERROR_NONE;
-       }
+       if (value == 1)
+               *gapless = true;
+       else
+               *gapless = false;
+
+       return PLAYER_ERROR_NONE;
+
 }
 
 int legacy_player_enable_media_packet_video_frame_decoded_cb(player_h player, bool enable)
 {
-       PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+       int ret = MM_ERROR_NONE;
+       int value = 0;
+       PLAYER_INSTANCE_CHECK(player);
        PLAYER_CHECK_CONDITION(handle->display_type == PLAYER_DISPLAY_TYPE_OVERLAY, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
 
-       int value = 0;
-       if (enable == true)
+       if (enable)
                value = 1;
 
-       int ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_ENABLE_VIDEO_DECODED_CB, value, (char *)NULL);
-
+       ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_ENABLE_VIDEO_DECODED_CB, value, (char *)NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_set_codec_type(player_h player, player_stream_type_e stream_type, player_codec_type_e codec_type)
 {
+       player_s *handle = (player_s *)player;
        int ret = MM_ERROR_NONE;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_CHECK_CONDITION(stream_type == PLAYER_STREAM_TYPE_AUDIO || stream_type == PLAYER_STREAM_TYPE_VIDEO, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
-
-       player_s * handle = (player_s *) player;
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
 
        LOGI("stream %d, codec %d", stream_type, codec_type);
        ret = mm_player_set_codec_type(handle->mm_handle, stream_type, codec_type);
        if (ret != MM_ERROR_NONE)
-               return __player_convert_error_code(ret, (char*)__FUNCTION__);
-       else
-               return PLAYER_ERROR_NONE;
+               return __player_convert_error_code(ret, (char *)__FUNCTION__);
+
+       return PLAYER_ERROR_NONE;
 }
 
 int legacy_player_get_codec_type(player_h player, player_stream_type_e stream_type, player_codec_type_e *pcodec_type)
 {
+       player_s *handle = (player_s *)player;
        int ret = MM_ERROR_NONE;
+       const char *attr_name;
        PLAYER_INSTANCE_CHECK(player);
        PLAYER_NULL_ARG_CHECK(pcodec_type);
        PLAYER_CHECK_CONDITION(stream_type == PLAYER_STREAM_TYPE_AUDIO || stream_type == PLAYER_STREAM_TYPE_VIDEO, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
 
-       player_s * handle = (player_s *) player;
-       const char* attr_name = (stream_type == PLAYER_STREAM_TYPE_AUDIO) ? (MM_PLAYER_AUDIO_CODEC_TYPE) : (MM_PLAYER_VIDEO_CODEC_TYPE);
+       attr_name = (stream_type == PLAYER_STREAM_TYPE_AUDIO) ? (MM_PLAYER_AUDIO_CODEC_TYPE) : (MM_PLAYER_VIDEO_CODEC_TYPE);
 
-       ret = mm_player_get_attribute(handle->mm_handle, NULL, attr_name, pcodec_type, (char*)NULL);
-       if (ret != MM_ERROR_NONE) {
-               return __player_convert_error_code(ret, (char*)__FUNCTION__);
-       } else {
-               LOGD("stream %d, codec %d", stream_type, *pcodec_type);
-               return PLAYER_ERROR_NONE;
-       }
-}
+       ret = mm_player_get_attribute(handle->mm_handle, NULL, attr_name, pcodec_type, (char *)NULL);
+       if (ret != MM_ERROR_NONE)
+               return __player_convert_error_code(ret, (char *)__FUNCTION__);
 
+       LOGD("stream %d, codec %d", stream_type, *pcodec_type);
+       return PLAYER_ERROR_NONE;
+}
index 1aaba4c..da83b16 100644 (file)
@@ -1,18 +1,18 @@
 /*
-* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 #ifndef __TIZEN_MEDIA_MUSE_PLAYER_H__
 #define        __TIZEN_MEDIA_MUSE_PLAYER_H__
@@ -28,7 +28,7 @@ extern "C" {
 #endif
 #define LOG_TAG "MMSVC_PLAYER"
 
-#define MUSE_PLAYER_HEAD_GAP(api) ((api)/(1000)+(1))*(1000)
+#define MUSE_PLAYER_HEAD_GAP(api) ((api) / (1000) + (1)) * (1000)
 
 /**
  * @brief Auto-generated enumeration for the muse player APIs.
index b1cf9a4..75fb031 100644 (file)
@@ -1,18 +1,18 @@
 /*
-* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 #ifndef __TIZEN_MEDIA_MUSE_PLAYER_MSG_H__
 #define __TIZEN_MEDIA_MUSE_PLAYER_MSG_H__
@@ -31,7 +31,7 @@ typedef int32_t INT;
 typedef int64_t INT64;
 typedef intptr_t POINTER;
 typedef double DOUBLE;
-typedef const charSTRING;
+typedef const char *STRING;
 
 typedef enum {
        PUSH_MEDIA_BUF_TYPE_TBM,
@@ -58,7 +58,7 @@ typedef struct {
        int win_roi_height;
 } wl_win_msg_type;
 
-extern int _player_disp_send_msg(int send_fd, charmsg, int *tfd);
+extern int _player_disp_send_msg(int send_fd, char *msg, int *tfd);
 
 /**
  * @brief Get value from Message.
index e582a3d..c5f52d8 100644 (file)
@@ -1,18 +1,18 @@
 /*
-* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 #ifndef __TIZEN_MEDIA_MUSE_PLAYER_PRIVATE_H__
 #define        __TIZEN_MEDIA_MUSE_PLAYER_PRIVATE_H__
index 853419e..0e22a6b 100644 (file)
@@ -1,18 +1,18 @@
 /*
-* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE
@@ -83,18 +83,18 @@ static bool _create_export_data(muse_player_handle_s *muse_player, void *data, i
 
        if (muse_player == NULL) {
                LOGE("handle is NULL");
-               return FALSE;
+               return false;
        }
 
        if (data == NULL || size <= 0) {
                LOGE("data is empty");
-               return FALSE;
+               return false;
        }
 
        export_data = g_try_new0(muse_player_export_data_s, 1);
        if (export_data == NULL) {
                LOGE("failed to alloc export_data");
-               return FALSE;
+               return false;
        }
 
        /* alloc and map the bo */
@@ -114,7 +114,7 @@ static bool _create_export_data(muse_player_handle_s *muse_player, void *data, i
        if (ext_size > 0 && ext_data != NULL)
                memcpy(thandle.ptr, ext_data, ext_size);
 
-       memcpy(thandle.ptr+ext_size, data, size);
+       memcpy(thandle.ptr + ext_size, data, size);
 
        tbm_bo_unmap(bo);
 
@@ -139,29 +139,28 @@ static bool _create_export_data(muse_player_handle_s *muse_player, void *data, i
        *out_tfd = export_data->tfd;
        *out_key = export_data->key;
 
-       return TRUE;
+       return true;
 
 ERROR:
        if (bo) {
                tbm_bo_unref(bo);
                bo = NULL;
        }
-       if (export_data) {
-               g_free(export_data);
-               export_data = NULL;
-       }
-       return FALSE;
+
+       g_free(export_data);
+
+       return false;
 }
 
-static bool _remove_export_data(muse_module_h module, int key, int remove_all)
+static bool _remove_export_data(muse_module_h module, int key, bool remove_all)
 {
-       bool ret = TRUE;
+       bool ret = true;
        muse_player_handle_s *muse_player = NULL;
 
        /* LOGD("ENTER"); */
-       if (module == NULL || (key < 0 && remove_all == FALSE)) {
+       if (module == NULL || (key < 0 && !remove_all)) {
                LOGE("invalid parameter %p, %d", module, key);
-               return FALSE;
+               return false;
        }
 
        muse_player = (muse_player_handle_s *)muse_server_ipc_get_handle(module);
@@ -211,7 +210,7 @@ static bool _remove_export_data(muse_module_h module, int key, int remove_all)
 
                if (!remove_all) {
                        LOGE("There is no key:%d in data_list", key);
-                       ret = FALSE;
+                       ret = false;
                }
        }
 
@@ -313,8 +312,8 @@ static void _remove_export_media_packet(muse_module_h module)
 /* check the given path is indicating sdp file */
 static bool _is_sdp_file(const char *path)
 {
-       gboolean ret = FALSE;
-       gcharuri = NULL;
+       bool ret = false;
+       gchar *uri = NULL;
 
        if (!path) {
                LOGE("invalid path param");
@@ -324,7 +323,7 @@ static bool _is_sdp_file(const char *path)
        uri = g_ascii_strdown(path, -1);
 
        if (uri == NULL)
-               return FALSE;
+               return false;
 
        /* trimming */
        g_strstrip(uri);
@@ -354,13 +353,13 @@ static bool _check_network_availability(void)
 #define _FEATURE_NAME_WIFI             "http://tizen.org/feature/network.wifi"
 #define _FEATURE_NAME_TELEPHONY        "http://tizen.org/feature/network.telephony"
 #define _FEATURE_NAME_ETHERNET "http://tizen.org/feature/network.ethernet"
-       bool enabled = FALSE;
-       bool supported = FALSE;
+       bool enabled = false;
+       bool supported = false;
 
        if (SYSTEM_INFO_ERROR_NONE == system_info_get_platform_bool(_FEATURE_NAME_WIFI, &enabled)) {
                LOGI("wifi status = %d", enabled);
                if (enabled)
-                       supported = TRUE;
+                       supported = true;
        } else {
                LOGE("SYSTEM_INFO_ERROR");
        }
@@ -368,7 +367,7 @@ static bool _check_network_availability(void)
        if (SYSTEM_INFO_ERROR_NONE == system_info_get_platform_bool(_FEATURE_NAME_TELEPHONY, &enabled)) {
                LOGI("telephony status = %d", enabled);
                if (enabled)
-                       supported = TRUE;
+                       supported = true;
        } else {
                LOGE("SYSTEM_INFO_ERROR");
        }
@@ -376,15 +375,15 @@ static bool _check_network_availability(void)
        if (SYSTEM_INFO_ERROR_NONE == system_info_get_platform_bool(_FEATURE_NAME_ETHERNET, &enabled)) {
                LOGI("ethernet status = %d", enabled);
                if (enabled)
-                       supported = TRUE;
+                       supported = true;
        } else {
                LOGE("SYSTEM_INFO_ERROR");
        }
 
        if (!supported)
-               return FALSE;
+               return false;
 
-       return TRUE;
+       return true;
 }
 
 static int _check_supportable(muse_module_h module, char *path)
@@ -421,7 +420,7 @@ static int _check_supportable(muse_module_h module, char *path)
                char *file_path = path;
 
                if (strncmp(path, "file://", strlen("file://")) == 0)
-                       file_path = path+7; /* remove file prefix */
+                       file_path = path + 7; /* remove file prefix */
 
                if (_is_sdp_file(file_path)) /* check internet privilege */
                        privilege = INTERNET_PRIVILEGE_NAME;
@@ -557,7 +556,7 @@ static void _capture_video_cb(unsigned char *data, int width, int height, unsign
        muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_CAPTURE;
        muse_module_h module = (muse_module_h)user_data;
        muse_player_handle_s *muse_player = NULL;
-       bool ret = TRUE;
+       bool ret = true;
        tbm_fd tfd = INVALID_DEFAULT_VALUE;
        int key = INVALID_DEFAULT_VALUE;
        LOGD("ENTER");
@@ -796,7 +795,7 @@ static bool __video_decoded_callback(void *video_data, void *user_data)
        muse_player->video_data_list = g_list_append(muse_player->video_data_list, (gpointer)video_data);
        g_mutex_unlock(&muse_player->list_lock);
 
-       msg_len = (surface_info_size/sizeof(int) + (surface_info_size%sizeof(int) ? 1 : 0));
+       msg_len = (surface_info_size / sizeof(int) + (surface_info_size % sizeof(int) ? 1 : 0));
        PLAYER_SEND_EVENT_MSG_WITH_TFDS(api, ev, module, tfd,
                MUSE_TYPE_INT, "key[0]", key[0], MUSE_TYPE_INT, "key[1]", key[1],
                MUSE_TYPE_INT, "key[2]", key[2], MUSE_TYPE_INT, "key[3]", key[3],
@@ -924,7 +923,7 @@ static void _subtitle_updated_cb(unsigned long duration, char *text, void *user_
        LOGD("ENTER");
 
        PLAYER_SEND_EVENT_MSG(api, ev, module,
-                       MUSE_TYPE_INT, "duration", (int)duration, MUSE_TYPE_STRING, "text", (const char*)text);
+                       MUSE_TYPE_INT, "duration", (int)duration, MUSE_TYPE_STRING, "text", (const char *)text);
 }
 
 static void _set_subtitle_cb(player_h player, void *module, bool set)
@@ -1150,8 +1149,9 @@ static int _push_media_stream(muse_player_handle_s *muse_player, player_push_med
                        ret |= media_format_set_audio_mime(muse_player->audio_format, push_media->mimetype);
                }
                format = muse_player->audio_format;
-       } else
+       } else {
                ret = MEDIA_FORMAT_ERROR_INVALID_PARAMETER;
+       }
 
        if (ret != MEDIA_FORMAT_ERROR_NONE) {
                LOGE("Invalid MIME %d", push_media->mimetype);
@@ -1184,7 +1184,7 @@ static int _push_media_stream(muse_player_handle_s *muse_player, player_push_med
        return ret;
 }
 
-static void _audio_frame_decoded_cb(player_audio_raw_data_s * audio_frame, void *user_data)
+static void _audio_frame_decoded_cb(player_audio_raw_data_s *audio_frame, void *user_data)
 {
        muse_player_cb_e api = MUSE_PLAYER_CB_EVENT;
        muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME;
@@ -1192,7 +1192,7 @@ static void _audio_frame_decoded_cb(player_audio_raw_data_s * audio_frame, void
        muse_player_handle_s *muse_player = NULL;
        void *data = NULL;
        int size = 0;
-       bool ret = TRUE;
+       bool ret = true;
        tbm_fd tfd = INVALID_DEFAULT_VALUE;
        int key = INVALID_DEFAULT_VALUE;
 
@@ -1225,7 +1225,7 @@ static void _audio_frame_decoded_cb(player_audio_raw_data_s * audio_frame, void
        return;
 }
 
-int _player_disp_send_msg(int send_fd, charmsg, int *tfd)
+int _player_disp_send_msg(int send_fd, char *msg, int *tfd)
 {
        int send_len = 0;
 
@@ -1234,11 +1234,11 @@ int _player_disp_send_msg(int send_fd, char* msg, int *tfd)
                return PLAYER_ERROR_INVALID_OPERATION;
        }
 
-       if (tfd != NULL) {
+       if (tfd != NULL)
                send_len = muse_core_msg_send_fd(send_fd, tfd, msg);
-       } else {
+       else
                send_len = muse_core_msg_send(send_fd, msg);
-       }
+
        if (send_len <= 0) {
                LOGE("sending message failed");
                return PLAYER_ERROR_INVALID_OPERATION;
@@ -1247,7 +1247,7 @@ int _player_disp_send_msg(int send_fd, char* msg, int *tfd)
        return PLAYER_ERROR_NONE;
 }
 
-int _player_disp_send_msg_async(int send_fd, charmsg)
+int _player_disp_send_msg_async(int send_fd, char *msg)
 {
        int send_len = 0;
 
@@ -1265,7 +1265,7 @@ int _player_disp_send_msg_async(int send_fd, char* msg)
        return PLAYER_ERROR_NONE;
 }
 
-static bool _player_disp_get_param_value(charbuf, ...)
+static bool _player_disp_get_param_value(char *buf, ...)
 {
        muse_core_msg_parse_err_e err = MUSE_MSG_PARSE_ERROR_NONE;
        bool ret = true;
@@ -1387,7 +1387,7 @@ int player_disp_destroy(muse_module_h module)
                muse_player->video_format = NULL;
        }
 
-       _remove_export_data(module, 0, TRUE);
+       _remove_export_data(module, 0, true);
        g_mutex_clear(&muse_player->list_lock);
 
        muse_player->bufmgr = NULL;
@@ -1456,8 +1456,7 @@ int player_disp_prepare_async(muse_module_h module)
        } /* else is error */
 
 ERROR:
-       if (prepare_data)
-               g_free(prepare_data);
+       g_free(prepare_data);
 
        PLAYER_RETURN_MSG(api, ret, module);
        return ret;
@@ -1476,7 +1475,7 @@ int player_disp_unprepare(muse_module_h module)
 
        ret = legacy_player_unprepare(muse_player->player_handle);
 
-       _remove_export_data(module, 0, TRUE);
+       _remove_export_data(module, 0, true);
 
        PLAYER_RETURN_MSG(api, ret, module);
 
@@ -1499,7 +1498,7 @@ int player_disp_set_uri(muse_module_h module)
        PLAYER_RETURN_MSG(api, ret, module);
 
        if (ret == PLAYER_ERROR_NONE) {
-               const charfile_buffering_path = muse_server_module_get_temporal_path();
+               const char *file_buffering_path = muse_server_module_get_temporal_path();
 
                LOGD("file buffering path : %s", file_buffering_path);
                if (file_buffering_path)
@@ -1617,7 +1616,7 @@ int player_disp_deinit_memory_buffer(muse_module_h module)        /* MUSE_PLAYER_API_DE
 
        if (player_msg_get(bo_addr, muse_server_module_get_msg(module))) {
 
-               bo = (tbm_bo) bo_addr;
+               bo = (tbm_bo)bo_addr;
 
                tbm_bo_unmap(bo);
                tbm_bo_unref(bo);
@@ -1648,7 +1647,7 @@ int player_disp_set_volume(muse_module_h module)
        muse_player_api_e api = MUSE_PLAYER_API_SET_VOLUME;
        muse_player_handle_s *muse_player = NULL;
        double left, right;
-       bool ret_val = TRUE;
+       bool ret_val = true;
 
        ret_val = _player_disp_get_param_value(muse_server_module_get_msg(module),
                                                                MUSE_TYPE_DOUBLE, "left", (void *)&left,
@@ -1688,7 +1687,7 @@ int player_disp_set_sound_stream_info(muse_module_h module)
        muse_player_handle_s *muse_player = NULL;
        int stream_index = 0;
        char stream_type[MUSE_URI_MAX_LENGTH] = { 0, };
-       bool ret_val = TRUE;
+       bool ret_val = true;
 
        ret_val = _player_disp_get_param_value(muse_server_module_get_msg(module),
                                                                MUSE_TYPE_INT, "stream_index", (void *)&stream_index,
@@ -1746,7 +1745,7 @@ int player_disp_set_play_position(muse_module_h module)
        muse_player_handle_s *muse_player = NULL;
        int64_t pos = 0;
        int accurate = 0;
-       bool ret_val = TRUE;
+       bool ret_val = true;
 
        ret_val = _player_disp_get_param_value(muse_server_module_get_msg(module),
                                                                MUSE_TYPE_INT64, "pos", (void *)&pos,
@@ -1919,7 +1918,7 @@ int player_disp_set_video_roi_area(muse_module_h module)
        muse_player_api_e api = MUSE_PLAYER_API_SET_VIDEO_ROI_AREA;
        muse_player_handle_s *muse_player = NULL;
        double x_scale = 0, y_scale = 0, w_scale = 0, h_scale = 0;
-       bool ret_val = TRUE;
+       bool ret_val = true;
 
        ret_val = _player_disp_get_param_value(muse_server_module_get_msg(module),
                                        MUSE_TYPE_DOUBLE, "x_scale", (void *)&x_scale,
@@ -2066,7 +2065,7 @@ int player_disp_get_content_info(muse_module_h module)
        int ret = PLAYER_ERROR_NONE;
        muse_player_handle_s *muse_player = NULL;
        muse_player_api_e api = MUSE_PLAYER_API_GET_CONTENT_INFO;
-       char *value;
+       char *value = NULL;
        player_content_info_e key;
 
        muse_player = (muse_player_handle_s *)muse_server_ipc_get_handle(module);
@@ -2075,10 +2074,12 @@ int player_disp_get_content_info(muse_module_h module)
        ret = legacy_player_get_content_info(muse_player->player_handle, key, &value);
 
        if (ret == PLAYER_ERROR_NONE) {
-               PLAYER_RETURN_MSG(api, ret, module, MUSE_TYPE_STRING, "value", (const char*)value);
-               free(value);
-       } else
+               PLAYER_RETURN_MSG(api, ret, module, MUSE_TYPE_STRING, "value", (const char *)value);
+               if (value)
+                       free(value);
+       } else {
                PLAYER_RETURN_MSG(api, ret, module);
+       }
 
        return ret;
 }
@@ -2088,8 +2089,8 @@ int player_disp_get_codec_info(muse_module_h module)
        int ret = PLAYER_ERROR_NONE;
        muse_player_handle_s *muse_player = NULL;
        muse_player_api_e api = MUSE_PLAYER_API_GET_CODEC_INFO;
-       char *video_codec;
-       char *audio_codec;
+       char *video_codec = NULL;
+       char *audio_codec = NULL;
 
        muse_player = (muse_player_handle_s *)muse_server_ipc_get_handle(module);
 
@@ -2097,13 +2098,15 @@ int player_disp_get_codec_info(muse_module_h module)
 
        if (ret == PLAYER_ERROR_NONE) {
                PLAYER_RETURN_MSG(api, ret, module,
-                               MUSE_TYPE_STRING, "audio_codec", (const char*)audio_codec,
-                               MUSE_TYPE_STRING, "video_codec", (const char*)video_codec);
-
-               free(audio_codec);
-               free(video_codec);
-       } else
+                               MUSE_TYPE_STRING, "audio_codec", (const char *)audio_codec,
+                               MUSE_TYPE_STRING, "video_codec", (const char *)video_codec);
+               if (audio_codec)
+                       free(audio_codec);
+               if (video_codec)
+                       free(video_codec);
+       } else {
                PLAYER_RETURN_MSG(api, ret, module);
+       }
 
        return ret;
 }
@@ -2170,7 +2173,7 @@ int player_disp_get_album_art(muse_module_h module)
        muse_player_api_e api = MUSE_PLAYER_API_GET_ALBUM_ART;
        void *album_art = NULL;
        int size = 0;
-       bool ret_val = TRUE;
+       bool ret_val = true;
        tbm_fd tfd = INVALID_DEFAULT_VALUE;
        int key = INVALID_DEFAULT_VALUE;
 
@@ -2268,7 +2271,7 @@ int player_disp_audio_effect_set_equalizer_band_level(muse_module_h module)
        muse_player_handle_s *muse_player = NULL;
        muse_player_api_e api = MUSE_PLAYER_API_AUDIO_EFFECT_SET_EQUALIZER_BAND_LEVEL;
        int index = 0, level = 0;
-       bool ret_val = TRUE;
+       bool ret_val = true;
 
        ret_val = _player_disp_get_param_value(muse_server_module_get_msg(module),
                                                                MUSE_TYPE_INT, "index", (void *)&index,
@@ -2702,7 +2705,7 @@ int player_disp_return_video_data(muse_module_h module) /* MUSE_PLAYER_API_RETUR
 {
        MMPlayerVideoStreamDataType *v_data = NULL;
        muse_player_handle_s *muse_player = NULL;
-       bool find_data = FALSE;
+       bool find_data = false;
 
        player_msg_get_type(v_data, muse_server_module_get_msg(module), POINTER);
 
@@ -2711,7 +2714,7 @@ int player_disp_return_video_data(muse_module_h module) /* MUSE_PLAYER_API_RETUR
                g_mutex_lock(&muse_player->list_lock);
                if (g_list_find(muse_player->video_data_list, v_data)) {
                        muse_player->video_data_list = g_list_remove(muse_player->video_data_list, v_data);
-                       find_data = TRUE;
+                       find_data = true;
                } else {
                        LOGW("the v_data(%p) is not in the exported list.", v_data);
                }
@@ -2731,7 +2734,7 @@ int player_disp_set_media_stream_buffer_max_size(muse_module_h module)
        muse_player_api_e api = MUSE_PLAYER_API_SET_MEDIA_STREAM_BUFFER_MAX_SIZE;
        player_stream_type_e type;
        unsigned long long max_size;
-       bool ret_val = TRUE;
+       bool ret_val = true;
 
        ret_val = _player_disp_get_param_value(muse_server_module_get_msg(module),
                                                                MUSE_TYPE_INT, "type", (void *)&type,
@@ -2778,7 +2781,7 @@ int player_disp_set_media_stream_buffer_min_threshold(muse_module_h module)
        muse_player_api_e api = MUSE_PLAYER_API_SET_MEDIA_STREAM_BUFFER_MIN_THRESHOLD;
        player_stream_type_e type;
        unsigned percent = 0;
-       bool ret_val = TRUE;
+       bool ret_val = true;
 
        ret_val = _player_disp_get_param_value(muse_server_module_get_msg(module),
                                                                MUSE_TYPE_INT, "type", (void *)&type,
@@ -2880,7 +2883,7 @@ int player_disp_select_track(muse_module_h module)
        muse_player_api_e api = MUSE_PLAYER_API_SELECT_TRACK;
        player_stream_type_e type;
        int index = 0;
-       bool ret_val = TRUE;
+       bool ret_val = true;
 
        ret_val = _player_disp_get_param_value(muse_server_module_get_msg(module),
                                                                MUSE_TYPE_INT, "type", (void *)&type,
@@ -2906,7 +2909,7 @@ int player_disp_get_track_language_code(muse_module_h module)
        int index = 0;
        char *code = NULL;
        int code_len = 0;
-       bool ret_val = TRUE;
+       bool ret_val = true;
 
        ret_val = _player_disp_get_param_value(muse_server_module_get_msg(module),
                                                                MUSE_TYPE_INT, "type", (void *)&type,
@@ -2922,7 +2925,7 @@ int player_disp_get_track_language_code(muse_module_h module)
        if (ret == PLAYER_ERROR_NONE)
                PLAYER_RETURN_MSG(api, ret, module,
                                                MUSE_TYPE_INT, "code_len", code_len,
-                                               MUSE_TYPE_STRING, "code", (const char*)code);
+                                               MUSE_TYPE_STRING, "code", (const char *)code);
        else
                PLAYER_RETURN_MSG(api, ret, module);
 
@@ -2957,7 +2960,7 @@ int player_disp_set_pcm_spec(muse_module_h module)
        char format[MUSE_URI_MAX_LENGTH] = { 0, };
        int samplerate = 0;
        int channel = 0;
-       bool ret_val = TRUE;
+       bool ret_val = true;
 
        ret_val = _player_disp_get_param_value(muse_server_module_get_msg(module),
                                                                MUSE_TYPE_INT, "samplerate", (void *)&samplerate,
@@ -3004,7 +3007,7 @@ int player_disp_return_buffer(muse_module_h module)       /* MUSE_PLAYER_API_RETURN_BU
 
        /* LOGD("handle : %p, key : %d", muse_player, key); */
 
-       if (!_remove_export_data(module, key, FALSE))
+       if (!_remove_export_data(module, key, false))
                LOGE("failed to remove export data : key %d", key);
 
        /* This funct does not send return value to client.        *
@@ -3041,8 +3044,9 @@ int player_disp_get_next_uri(muse_module_h module)
 
        ret = legacy_player_get_next_uri(muse_player->player_handle, &next_uri);
        if (ret == PLAYER_ERROR_NONE) {
-               PLAYER_RETURN_MSG(api, ret, module, MUSE_TYPE_STRING, "next_uri", (const char*)next_uri);
-               free(next_uri);
+               PLAYER_RETURN_MSG(api, ret, module, MUSE_TYPE_STRING, "next_uri", (const char *)next_uri);
+               if (next_uri)
+                       free(next_uri);
        } else {
                PLAYER_RETURN_MSG(api, ret, module);
        }
@@ -3072,7 +3076,7 @@ int player_disp_is_gapless(muse_module_h module)
        int ret = PLAYER_ERROR_NONE;
        muse_player_api_e api = MUSE_PLAYER_API_IS_GAPLESS;
        muse_player_handle_s *muse_player = NULL;
-       bool value = FALSE;
+       bool value = false;
 
        muse_player = (muse_player_handle_s *)muse_server_ipc_get_handle(module);
 
@@ -3138,7 +3142,7 @@ int player_disp_get_adaptive_variant_info(muse_module_h module)
        else
                PLAYER_RETURN_MSG(api, ret, module,
                                MUSE_TYPE_INT, "num", num,
-                               MUSE_TYPE_STRING, "var_info", (const char*)var_info);
+                               MUSE_TYPE_STRING, "var_info", (const char *)var_info);
 
        g_free(var_info);
 
@@ -3150,7 +3154,7 @@ int player_disp_set_max_adaptive_variant_limit(muse_module_h module)
        int ret = PLAYER_ERROR_NONE;
        muse_player_api_e api = MUSE_PLAYER_API_SET_MAX_ADAPTIVE_VARIANT_LIMIT;
        muse_player_handle_s *muse_player = NULL;
-       bool ret_val = TRUE;
+       bool ret_val = true;
        int bandwidth = ADAPTIVE_VARIANT_DEFAULT_VALUE;
        int width = ADAPTIVE_VARIANT_DEFAULT_VALUE;
        int height = ADAPTIVE_VARIANT_DEFAULT_VALUE;
@@ -3321,7 +3325,7 @@ int player_disp_360_set_direction_of_view(muse_module_h module)
        muse_player_api_e api = MUSE_PLAYER_API_360_SET_DIRECTION_OF_VIEW;
        muse_player_handle_s *muse_player = NULL;
        double yaw, pitch;
-       bool ret_val = TRUE;
+       bool ret_val = true;
 
        ret_val = _player_disp_get_param_value(muse_server_module_get_msg(module),
                                                                MUSE_TYPE_DOUBLE, "yaw", (void *)&yaw,
@@ -3392,7 +3396,7 @@ int player_disp_360_set_field_of_view(muse_module_h module)
        muse_player_api_e api = MUSE_PLAYER_API_360_SET_FIELD_OF_VIEW;
        muse_player_handle_s *muse_player = NULL;
        int horizontal_degrees = 0, vertical_degrees = 0;
-       bool ret_val = TRUE;
+       bool ret_val = true;
 
        ret_val = _player_disp_get_param_value(muse_server_module_get_msg(module),
                                                                MUSE_TYPE_INT, "horizontal_degrees", (void *)&horizontal_degrees,
@@ -3431,7 +3435,7 @@ int player_disp_360_set_zoom_with_field_of_view(muse_module_h module)
        muse_player_handle_s *muse_player = NULL;
        int horizontal_degrees = 0, vertical_degrees = 0;
        double level = 0;
-       bool ret_val = TRUE;
+       bool ret_val = true;
 
        ret_val = _player_disp_get_param_value(muse_server_module_get_msg(module),
                                                                MUSE_TYPE_DOUBLE, "level", (void *)&level,
index 4e23d26..0b10f7c 100644 (file)
@@ -1,18 +1,18 @@
 /*
-* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 #include <dlog.h>
 #include "muse_player.h"
@@ -95,7 +95,7 @@ static int player_cmd_external_storage_state_changed(muse_module_h module)
                return PLAYER_ERROR_NONE;
        }
 
-       storage_info = (muse_external_storage_info_t *)(data);
+       storage_info = (muse_external_storage_info_t *)data;
 
        LOGW("external state is changed %d:%d", storage_info->id, storage_info->state);
        legacy_player_manage_external_storage_state(muse_player->player_handle, storage_info->id, storage_info->state);
@@ -127,4 +127,3 @@ int (*cmd_dispatcher[MUSE_MODULE_COMMAND_MAX])(muse_module_h module) = {
 int (*dispatcher[MUSE_PLAYER_API_MAX])(muse_module_h module) = {
 #include "muse_player_api.func"
 };
-
index cd95d9e..f83cc96 100644 (file)
@@ -1,25 +1,25 @@
 /*
-* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 #include "muse_player.h"
 #include "muse_player_msg.h"
 
 /*
-* This is only for build verify
-* Does NOT include package
-*/
+ * This is only for build verify
+ * Does NOT include package
+ */
 
 int main()
 {
index df462fa..2bf9856 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-player
 Summary:    A Media Player module for muse server
-Version:    0.2.95
+Version:    0.2.96
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0