[0.6.32] check seekable with query before request seek 78/115978/1 accepted/tizen/3.0/common/20170227.135906 accepted/tizen/3.0/ivi/20170227.090729 accepted/tizen/3.0/mobile/20170227.090449 accepted/tizen/3.0/tv/20170227.090611 accepted/tizen/3.0/wearable/20170227.090640 submit/tizen_3.0/20170224.035858
authorEunhae Choi <eunhae1.choi@samsung.com>
Wed, 22 Feb 2017 08:07:36 +0000 (17:07 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Wed, 22 Feb 2017 08:07:36 +0000 (17:07 +0900)
Change-Id: I1bc674111fcb7ea456077afebb7c8ca77ac3c39b

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

index 46b04e79a22b391c8aac2608a88c30a37c542cda..28b84483a06dca47778ac02432bc481a864abb32 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 d098450b15f78f3114294b7ed16114f22c54d14a..6ded73d16cd98d2f894aa41a8506506eaaa16d46 100644 (file)
@@ -7468,8 +7468,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;
                }
@@ -7494,10 +7495,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.