}
static int
-__mmplayer_gst_check_duration(mmplayer_t *player, gint64 position)
+__mmplayer_gst_check_position(mmplayer_t *player, gint64 position)
{
gint64 dur_nsec = 0;
+ gint64 pos_nsec = 0;
MMPLAYER_FENTER();
MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline, MM_ERROR_PLAYER_NOT_INITIALIZED);
return MM_ERROR_INVALID_ARGUMENT;
}
+ if (gst_element_query_position(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &pos_nsec)) {
+ if ((pos_nsec == player->duration) && /* current pos is end of stream */
+ ((position / GST_MSECOND) == (player->duration / GST_MSECOND))) {
+ MMPLAYER_POST_MSG(player, MM_MESSAGE_SEEK_COMPLETED, NULL);
+ player->seek_state = MMPLAYER_SEEK_NONE;
+ return MM_ERROR_PLAYER_NO_OP;
+ }
+ }
+
MMPLAYER_FLEAVE();
return MM_ERROR_NONE;
}
&& (MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_PAUSED))
goto PENDING;
- ret = __mmplayer_gst_check_duration(player, position);
+ ret = __mmplayer_gst_check_position(player, position);
if (ret != MM_ERROR_NONE) {
- LOGE("failed to check duration 0x%X", ret);
+ LOGW("result of check position info 0x%X", ret);
return (ret == MM_ERROR_PLAYER_NO_OP) ? MM_ERROR_NONE : ret;
}