[0.6.89] fix bug about _get_stream_service_type 52/167252/1 accepted/tizen/4.0/unified/20180123.105139 submit/tizen_4.0/20180118.070828
authorEunhae Choi <eunhae1.choi@samsung.com>
Tue, 16 Jan 2018 10:45:14 +0000 (19:45 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Tue, 16 Jan 2018 10:45:19 +0000 (19:45 +0900)
Change-Id: Ibfe155ae24de485eae21ace2fe0f9c2b46527c7b
(cherry picked from commit 2a58f78ad67b67d79efa90d410f3e78f7fe4eb21)

src/mm_player_priv.c

index a42f68f355c6007b29f6ccc2e222426152a89a03..1fe7e0a005087a7514ada492afbc3cdeb002c032 100644 (file)
@@ -153,7 +153,7 @@ static void __mmplayer_set_audio_attrs(mm_player_t* player, GstCaps* caps);
 
 static void            __mmplayer_gst_rtp_no_more_pads(GstElement *element,  gpointer data);
 static void            __mmplayer_gst_rtp_dynamic_pad(GstElement *element, GstPad *pad, gpointer data);
-static gboolean        __mmplayer_get_stream_service_type(mm_player_t* player);
+static MMStreamingType __mmplayer_get_stream_service_type(mm_player_t* player);
 static gboolean        __mmplayer_update_subtitle(GstElement* object, GstBuffer *buffer, GstPad *pad, gpointer data);
 static void            __mmplayer_release_misc(mm_player_t* player);
 static void            __mmplayer_release_misc_post(mm_player_t* player);
@@ -299,7 +299,7 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag)
        GstStructure* p = NULL;
        MMHandleType attrs = 0;
        gchar *path = NULL;
-       gint stream_service_type = STREAMING_SERVICE_NONE;
+       MMStreamingType stream_service_type = STREAMING_SERVICE_NONE;
        struct stat sb;
 
        MMPLAYER_FENTER();
@@ -358,7 +358,8 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag)
 
                /* try to get streaming service type */
                stream_service_type = __mmplayer_get_stream_service_type(player);
-               mm_attrs_set_int_by_name(attrs, "streaming_type", stream_service_type);
+               if (stream_service_type < STREAMING_SERVICE_NONE)
+                       mm_attrs_set_int_by_name(attrs, "streaming_type", stream_service_type);
 
                /* check duration is OK */
                if (dur_nsec == 0 && !MMPLAYER_IS_LIVE_STREAMING(player)) {
@@ -523,9 +524,9 @@ _mmplayer_update_content_attrs(mm_player_t* player, enum content_attr_flag flag)
        return TRUE;
 }
 
-static gboolean __mmplayer_get_stream_service_type(mm_player_t* player)
+static MMStreamingType __mmplayer_get_stream_service_type(mm_player_t* player)
 {
-       gint streaming_type = STREAMING_SERVICE_NONE;
+       MMStreamingType streaming_type = STREAMING_SERVICE_NONE;
 
        MMPLAYER_FENTER();
 
@@ -533,7 +534,7 @@ static gboolean __mmplayer_get_stream_service_type(mm_player_t* player)
                        player->pipeline &&
                        player->pipeline->mainbin &&
                        player->pipeline->mainbin[MMPLAYER_M_SRC].gst,
-                       FALSE);
+                       STREAMING_SERVICE_NONE);
 
        /* streaming service type if streaming */
        if (!MMPLAYER_IS_STREAMING(player))
@@ -7642,7 +7643,7 @@ __gst_set_position(mm_player_t* player, int format, unsigned long position, gboo
                        if (!gst_element_query_duration(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &dur_nsec)) {
                                /* For RTSP Streaming , duration is not returned in READY state. So seek to the previous position does not work properly.
                                 * Added a patch to postpone the actual seek when state changes to PLAY. Sending a fake SEEK_COMPLETED event to finish the current request. */
-                               if ((MMPLAYER_IS_RTSP_STREAMING(player)) && (__mmplayer_get_stream_service_type(player) != STREAMING_SERVICE_LIVE)) {
+                               if ((MMPLAYER_IS_RTSP_STREAMING(player)) && (__mmplayer_get_stream_service_type(player) == STREAMING_SERVICE_VOD)) {
                                        player->pending_seek.is_pending = TRUE;
                                        player->pending_seek.format = format;
                                        player->pending_seek.pos = position;
@@ -7705,7 +7706,7 @@ __gst_set_position(mm_player_t* player, int format, unsigned long position, gboo
                           This causes problem is position calculation during normal pause resume scenarios also.
                           Currently during seek , we are sending the current position to rtspsrc module for position saving for later use. */
                        if ((MMPLAYER_IS_RTSP_STREAMING(player)) &&
-                               (__mmplayer_get_stream_service_type(player) != STREAMING_SERVICE_LIVE)) {
+                               (__mmplayer_get_stream_service_type(player) == STREAMING_SERVICE_VOD)) {
                                if (!gst_element_query_position(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &pos_nsec))
                                        LOGW("getting current position failed in seek\n");
 
@@ -9846,7 +9847,7 @@ _mmplayer_pause(MMHandleType hplayer)
                           This causes problem is position calculation during normal pause resume scenarios also.
                           Currently during pause , we are sending the current position to rtspsrc module for position saving. */
                        if ((MMPLAYER_IS_RTSP_STREAMING(player)) &&
-                               (__mmplayer_get_stream_service_type(player) != STREAMING_SERVICE_LIVE)) {
+                               (__mmplayer_get_stream_service_type(player) == STREAMING_SERVICE_VOD)) {
                                g_object_set(player->pipeline->mainbin[MMPLAYER_M_SRC].gst, "resume-position", player->last_position, NULL);
                        }
                }