[0.6.32] check seekable with query before request seek 54/116954/1 accepted/tizen/common/20170303.090902 accepted/tizen/ivi/20170303.070014 accepted/tizen/mobile/20170303.065854 accepted/tizen/tv/20170303.065927 accepted/tizen/unified/20170309.033413 accepted/tizen/wearable/20170303.065953 submit/tizen/20170303.015115 submit/tizen_unified/20170308.100408
authorEunhae Choi <eunhae1.choi@samsung.com>
Wed, 22 Feb 2017 08:07:36 +0000 (17:07 +0900)
committereunhae choi <eunhae1.choi@samsung.com>
Thu, 2 Mar 2017 06:25:38 +0000 (22:25 -0800)
Change-Id: I1bc674111fcb7ea456077afebb7c8ca77ac3c39b
(cherry picked from commit 3cde68d388aa0ba97b9260a4b0f8a22898e9e216)

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

index 774741c..5301f10 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.31
+Version:    0.6.32
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 25388ea..f876e1a 100644 (file)
@@ -7480,8 +7480,9 @@ __gst_set_position(mm_player_t* player, int format, unsigned long position, gboo
                                        player->doing_seek = FALSE;
                                        MMPLAYER_POST_MSG ( player, MM_MESSAGE_SEEK_COMPLETED, NULL );
                                        return MM_ERROR_NONE;
-                               } else
-                               goto SEEK_ERROR;
+                               } else {
+                                       goto SEEK_ERROR;
+                               }
                        }
                        player->duration = dur_nsec;
                }
@@ -7506,10 +7507,28 @@ __gst_set_position(mm_player_t* player, int format, unsigned long position, gboo
        case MM_PLAYER_POS_FORMAT_TIME:
        {
                if (!MMPLAYER_IS_MS_BUFF_SRC(player)) {
+                       GstQuery *query = NULL;
+                       gboolean seekable = FALSE;
+
                        /* check position is valid or not */
                        if (position > dur_msec)
                                goto INVALID_ARGS;
 
+                       query = gst_query_new_seeking (GST_FORMAT_TIME);
+                       if (gst_element_query (player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, query)) {
+                               gst_query_parse_seeking (query, NULL, &seekable, NULL, NULL);
+                               gst_query_unref (query);
+
+                               if (!seekable) {
+                                       LOGW("non-seekable content");
+                                       player->doing_seek = FALSE;
+                                       return MM_ERROR_PLAYER_NO_OP;
+                               }
+                       } else {
+                               LOGW("failed to get seeking query");
+                               gst_query_unref (query); /* keep seeking operation */
+                       }
+
                        LOGD("seeking to(%lu) msec, duration is %d msec\n", position, dur_msec);
 
                        /* For rtspsrc stack , npt-start value coming from server is used for finding the current position.