+ /* in paused state, seek to current pos to flush mq buffer and release waiting task */
+ if (MMPLAYER_CURRENT_STATE(player) == MM_PLAYER_STATE_PAUSED) {
+ gint64 pos_nsec = GST_CLOCK_TIME_NONE;
+
+ if (!gst_element_query_position(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_FORMAT_TIME, &pos_nsec))
+ pos_nsec = player->last_position;
+
+ LOGD("current pos %" GST_TIME_FORMAT ", rate = %f", GST_TIME_ARGS(pos_nsec), player->playback_rate);
+
+ if (!_mmplayer_gst_seek(player, player->pipeline->mainbin[MMPLAYER_M_PIPE].gst,
+ player->playback_rate, GST_FORMAT_TIME,
+ (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE),
+ GST_SEEK_TYPE_SET, pos_nsec, GST_SEEK_TYPE_SET, GST_CLOCK_TIME_NONE)) {
+ LOGW("failed to seek");
+ return MM_ERROR_PLAYER_INTERNAL;
+ }
+ }
+