track *temp = head_track->head;
track *temp_track = head_track->head;
int indx = 0;
+ bool is_seek = FALSE;
/* Setting each appsink to paused state before seek */
while (temp_track) {
indx = 0;
while (temp) {
- MD_I("Got one element %p\n", temp->appsink);
+ MD_I("Got one element %p {%s}\n", temp->appsink, GST_ELEMENT_NAME(temp->appsink));
if (gst_handle->selected_tracks[indx] == true) {
temp->need_codec_data = TRUE;
- if (!gst_element_seek(temp->appsink, rate, GST_FORMAT_TIME,
- GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_BEFORE,
- GST_SEEK_TYPE_SET, pos, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)) {
- MD_E("Seek failed!\n");
- goto ERROR;
- } else {
- MD_I("Seek success...setting appsink to playing state\n");
- if (gst_element_set_state(temp->appsink, GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) {
- MD_E("Failed to set into PLAYING state");
+
+ if (!is_seek) {
+ if (!gst_element_seek(temp->appsink, rate, GST_FORMAT_TIME,
+ GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_BEFORE,
+ GST_SEEK_TYPE_SET, pos, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)) {
+ MD_E("Seek failed!\n");
goto ERROR;
}
+ is_seek = TRUE;
+ }
+ MD_I("Seek success...setting appsink to playing state\n");
+ if (gst_element_set_state(temp->appsink, GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) {
+ MD_E("Failed to set into PLAYING state");
+ goto ERROR;
}
}
indx++;
temp = NULL;
}
}
+
MEDIADEMUXER_FLEAVE();
return MD_ERROR_NONE;
ERROR: