diff options
author | Eunhye Choi <eunhae1.choi@samsung.com> | 2021-11-15 16:52:36 +0900 |
---|---|---|
committer | Eunhye Choi <eunhae1.choi@samsung.com> | 2021-11-15 19:09:39 +0900 |
commit | 1ab72f7b8ae65d6bd42062d5de97390232d7b83e (patch) | |
tree | 2913a411ee44831255333d96e4b707ed4bf73088 | |
parent | 552f65c3a1fad70a2056d4e130aa4761dc3e57ed (diff) | |
download | libmm-player-accepted/tizen/6.5/unified/20211117.024249.tar.gz libmm-player-accepted/tizen/6.5/unified/20211117.024249.tar.bz2 libmm-player-accepted/tizen/6.5/unified/20211117.024249.zip |
[0.6.268] handle seek to eossubmit/tizen_6.5/20211115.101113accepted/tizen/6.5/unified/20211117.024249
- skip to seek to end of stream
if the current pos is already eos
Change-Id: I6be9b88d0d3f3e002521a099732718dbb5816072
-rw-r--r-- | packaging/libmm-player.spec | 2 | ||||
-rw-r--r-- | src/mm_player_gst.c | 16 |
2 files changed, 14 insertions, 4 deletions
diff --git a/packaging/libmm-player.spec b/packaging/libmm-player.spec index 636ba47..60683a4 100644 --- a/packaging/libmm-player.spec +++ b/packaging/libmm-player.spec @@ -1,6 +1,6 @@ Name: libmm-player Summary: Multimedia Framework Player Library -Version: 0.6.267 +Version: 0.6.268 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/mm_player_gst.c b/src/mm_player_gst.c index 7961390..e509314 100644 --- a/src/mm_player_gst.c +++ b/src/mm_player_gst.c @@ -3410,9 +3410,10 @@ static gpointer __mmplayer_gst_bus_msg_thread(gpointer data) } 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); @@ -3447,6 +3448,15 @@ __mmplayer_gst_check_duration(mmplayer_t *player, gint64 position) 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; } @@ -3941,9 +3951,9 @@ _mmplayer_gst_set_position(mmplayer_t *player, gint64 position, gboolean interna && (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; } |