[0.6.135] adjust the pd timeout 87/190887/2
authorEunhae Choi <eunhae1.choi@samsung.com>
Mon, 8 Oct 2018 08:58:19 +0000 (17:58 +0900)
committereunhae choi <eunhae1.choi@samsung.com>
Mon, 8 Oct 2018 09:04:00 +0000 (09:04 +0000)
- change _handle_async funct name
- start funct timeout is too long and it can cause crash
- playback pipeline timeout is changed from 30 sec to 20 sec
  and it is included in the api timeout

Change-Id: I718f4111575f3503e17a10341a8555c05ebded08

packaging/libmm-player.spec
src/mm_player_gst.c
src/mm_player_priv.c

index 21eedee..bfb1b40 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.134
+Version:    0.6.135
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 1c9ab19..3b59663 100644 (file)
@@ -1322,7 +1322,7 @@ static int __mmplayer_gst_pending_seek(mm_player_t* player)
 }
 
 static void
-__mmplayer_gst_handle_async(mm_player_t* player, gboolean async, enum MMPlayerSinkType type)
+__mmplayer_gst_set_async(mm_player_t* player, gboolean async, enum MMPlayerSinkType type)
 {
        MMPlayerGstElement *videobin = NULL, *audiobin = NULL, *textbin = NULL;
 
@@ -1363,7 +1363,7 @@ __mmplayer_drop_subtitle(mm_player_t* player, gboolean is_drop)
        if (is_drop) {
                LOGD("Drop subtitle text after getting EOS\n");
 
-               __mmplayer_gst_handle_async(player, FALSE, MMPLAYER_TEXT_SINK);
+               __mmplayer_gst_set_async(player, FALSE, MMPLAYER_TEXT_SINK);
                g_object_set(textbin[MMPLAYER_T_IDENTITY].gst, "drop-probability", (gfloat)1.0, NULL);
 
                player->is_subtitle_force_drop = TRUE;
@@ -1372,7 +1372,7 @@ __mmplayer_drop_subtitle(mm_player_t* player, gboolean is_drop)
                        LOGD("Enable subtitle data path without drop\n");
 
                        g_object_set(textbin[MMPLAYER_T_IDENTITY].gst, "drop-probability", (gfloat)0.0, NULL);
-                       __mmplayer_gst_handle_async(player, TRUE, MMPLAYER_TEXT_SINK);
+                       __mmplayer_gst_set_async(player, TRUE, MMPLAYER_TEXT_SINK);
 
                        LOGD("non-connected with external display");
 
@@ -3160,7 +3160,7 @@ int __mmplayer_gst_stop(mm_player_t* player)
 
        if (player->es_player_push_mode || MMPLAYER_IS_HTTP_PD(player)) {
                /* disable the async state transition because there could be no data in the pipeline */
-               __mmplayer_gst_handle_async(player, FALSE, MMPLAYER_SINK_ALL);
+               __mmplayer_gst_set_async(player, FALSE, MMPLAYER_SINK_ALL);
        }
 
        /* set gst state */
@@ -3168,7 +3168,7 @@ int __mmplayer_gst_stop(mm_player_t* player)
 
        if (player->es_player_push_mode || MMPLAYER_IS_HTTP_PD(player)) {
                /* enable the async state transition as default operation */
-               __mmplayer_gst_handle_async(player, TRUE, MMPLAYER_SINK_ALL);
+               __mmplayer_gst_set_async(player, TRUE, MMPLAYER_SINK_ALL);
        }
 
        /* return if set_state has failed */
index ea975b2..84ba58c 100644 (file)
 
 /* For PD mode */
 #define PLAYER_PD_EXT_MAX_SIZE_BYTE            1024 * 1024 * 3
+#define PLAYER_PD_STATE_CHANGE_TIME            20 /* sec */
 
 #define PLAYER_SPHERICAL_DEFAULT_YAW   0  /* sync from video360 plugin */
 #define PLAYER_SPHERICAL_DEFAULT_PITCH 0
@@ -5836,7 +5837,9 @@ _mmplayer_realize(MMHandleType hplayer)
                return MM_ERROR_PLAYER_NOT_SUPPORTED_FORMAT;
        }
 
-       if (MMPLAYER_IS_STREAMING(player))
+       if (MMPLAYER_IS_HTTP_PD(player))
+               MMPLAYER_STATE_CHANGE_TIMEOUT(player) = PLAYER_PD_STATE_CHANGE_TIME;
+       else if (MMPLAYER_IS_STREAMING(player))
                MMPLAYER_STATE_CHANGE_TIMEOUT(player) = player->ini.live_state_change_timeout;
        else
                MMPLAYER_STATE_CHANGE_TIMEOUT(player) = player->ini.localplayback_state_change_timeout;
@@ -9657,7 +9660,8 @@ int _mmplayer_get_timeout(MMHandleType hplayer, int *timeout)
        MMPLAYER_RETURN_VAL_IF_FAIL(timeout, MM_ERROR_COMMON_INVALID_ARGUMENT);
 
        if (MMPLAYER_IS_HTTP_PD(player))
-               *timeout = player->ini.live_state_change_timeout*2;
+               /* consider the timeout both download pipeline and playback pipeline */
+               *timeout = player->ini.live_state_change_timeout + PLAYER_PD_STATE_CHANGE_TIME;
        else if (MMPLAYER_IS_STREAMING(player))
                *timeout = player->ini.live_state_change_timeout;
        else