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;
}
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.