[0.6.241] apply select-stream event for audio only
[platform/core/multimedia/libmm-player.git] / src / mm_player.c
index bcd2d7d..e572e20 100644 (file)
@@ -54,7 +54,7 @@ int mm_player_create(MMHandleType *player)
        }
 
        /* create player lock and cond */
-       g_mutex_init(&new_player->cmd_lock);
+       MMPLAYER_CMD_LOCK_INIT(new_player);
        g_mutex_init(&new_player->reconfigure_lock);
        g_cond_init(&new_player->reconfigure_cond);
 
@@ -86,7 +86,7 @@ ERROR:
 
        if (new_player) {
                _mmplayer_destroy((MMHandleType)new_player);
-               g_mutex_clear(&new_player->cmd_lock);
+               MMPLAYER_CMD_LOCK_DEINIT(new_player);
                g_mutex_clear(&new_player->reconfigure_lock);
                g_cond_clear(&new_player->reconfigure_cond);
                MMPLAYER_FREEIF(new_player);
@@ -102,6 +102,7 @@ int mm_player_destroy(MMHandleType player)
 
        MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
+       _mmplayer_bus_watcher_remove(player);
        /* destroy the gst bus msg thread if it is remained.
           this funct have to be called before getting cmd lock. */
        _mmplayer_bus_msg_thread_destroy(player);
@@ -112,7 +113,10 @@ int mm_player_destroy(MMHandleType player)
 
        MMPLAYER_CMD_UNLOCK(player);
 
-       g_mutex_clear(&((mmplayer_t *)player)->cmd_lock);
+       MMPLAYER_CMD_LOCK(player);
+       MMPLAYER_CMD_UNLOCK(player);
+
+       MMPLAYER_CMD_LOCK_DEINIT(player);
        g_mutex_clear(&((mmplayer_t *)player)->reconfigure_lock);
        g_cond_clear(&((mmplayer_t *)player)->reconfigure_cond);
 
@@ -145,6 +149,7 @@ int mm_player_abort_pause(MMHandleType player)
 
        MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
 
+       _mmplayer_bus_watcher_remove(player);
        /* destroy the gst bus msg thread not to be blocked in pause(without cmd lock). */
        _mmplayer_bus_msg_thread_destroy(player);
 
@@ -482,7 +487,7 @@ int mm_player_adjust_subtitle_position(MMHandleType player, int pos)
 
        MMPLAYER_CMD_LOCK(player);
 
-       result = _mmplayer_adjust_subtitle_postion(player, pos);
+       result = _mmplayer_adjust_subtitle_position(player, pos);
 
        MMPLAYER_CMD_UNLOCK(player);
 
@@ -1005,22 +1010,6 @@ int mm_player_set_audio_only(MMHandleType player, bool audio_only)
        return result;
 }
 
-int mm_player_get_audio_only(MMHandleType player, bool *audio_only)
-{
-       int result = MM_ERROR_NONE;
-
-       MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
-       MMPLAYER_RETURN_VAL_IF_FAIL(audio_only, MM_ERROR_INVALID_ARGUMENT);
-
-       MMPLAYER_CMD_LOCK(player);
-
-       result = _mmplayer_get_audio_only(player, audio_only);
-
-       MMPLAYER_CMD_UNLOCK(player);
-
-       return result;
-}
-
 int mm_player_360_is_content_spherical(MMHandleType player, bool *is_spherical)
 {
        int result = MM_ERROR_NONE;