Patch to only send one seek event for the pipeline 76/121376/2 accepted/tizen/3.0/common/20170330.125222 accepted/tizen/3.0/ivi/20170330.092058 accepted/tizen/3.0/mobile/20170330.091904 accepted/tizen/3.0/tv/20170330.091956 accepted/tizen/3.0/wearable/20170330.092026 submit/tizen_3.0/20170329.075800
authorjuan82.liu <juan82.liu@samsung.com>
Mon, 27 Mar 2017 17:22:57 +0000 (01:22 +0800)
committerjuan82.liu <juan82.liu@samsung.com>
Mon, 27 Mar 2017 17:28:16 +0000 (01:28 +0800)
[Version] 0.1.19
[Profile] Mobile, Wearable, TV
[Issue Type] Fix bugs

Change-Id: I4fa0af2debcbeccc59cbb17e9a57c2e1e3ba08e8

packaging/capi-mediademuxer.spec
src/port_gst/mediademuxer_port_gst.c

index 2ee5daf..b39adf5 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-mediademuxer
 Summary:    A Media Demuxer library in Tizen Native API
-Version:    0.1.18
+Version:    0.1.19
 Release:    1
 Group:      Multimedia/API
 License:    Apache-2.0
index 2d0e2b7..61be3e3 100755 (executable)
@@ -1627,6 +1627,7 @@ static int gst_demuxer_seek(MMHandleType pHandle, gint64 pos1)
        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) {
@@ -1652,20 +1653,23 @@ static int gst_demuxer_seek(MMHandleType pHandle, gint64 pos1)
 
        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++;
@@ -1676,6 +1680,7 @@ static int gst_demuxer_seek(MMHandleType pHandle, gint64 pos1)
                        temp = NULL;
                }
        }
+
        MEDIADEMUXER_FLEAVE();
        return MD_ERROR_NONE;
 ERROR: