If decoded buffer timestamp is less than start position, will be dropped buffer 37/45937/1
authorGilbok Lee <gilbok.lee@samsung.com>
Wed, 12 Aug 2015 10:47:39 +0000 (19:47 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Wed, 12 Aug 2015 10:47:39 +0000 (19:47 +0900)
Change-Id: I17fe595bd1fb6029b2fc0146cb805066c2c279b9
Signed-off-by: Gilbok Lee <gilbok.lee@samsung.com>
packaging/libmm-transcode.spec
transcode/mm_transcode_seek.c

index 303857f..e8dd8f8 100644 (file)
@@ -1,7 +1,7 @@
 Name:       libmm-transcode
 Summary:    Multimedia Framework Video Transcode Library
 Version:    0.9
-Release:    7
+Release:    8
 Group:      System/Libraries
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
index 302be8d..1289529 100755 (executable)
@@ -60,7 +60,15 @@ _mm_cb_audio_output_stream_probe(GstPad *pad, GstPadProbeInfo *info, gpointer us
 
                if (handle->param->seeking) {
                        /* Shifting the decoded out buffer time as the start time */
-                       GST_BUFFER_PTS (GST_PAD_PROBE_INFO_BUFFER(info)) -= start_pos_ts;
+                       if (GST_BUFFER_PTS (GST_PAD_PROBE_INFO_BUFFER(info)) >= start_pos_ts) {
+                               GST_BUFFER_PTS (GST_PAD_PROBE_INFO_BUFFER(info)) -= start_pos_ts;
+                       } else {
+                               /* If input buffer time is less than start position,
+                                * input buffer will be dropped.
+                                */
+                               return GST_PAD_PROBE_DROP;
+                       }
+
                }
        }
        return GST_PAD_PROBE_OK;
@@ -95,7 +103,15 @@ _mm_cb_video_output_stream_probe(GstPad *pad, GstPadProbeInfo *info, gpointer us
 
                if(handle->param->seeking) {
                        /* Shifting the decoded out buffer time as the start time */
-                       GST_BUFFER_PTS (GST_PAD_PROBE_INFO_BUFFER(info)) -= start_pos_ts;
+                       if (GST_BUFFER_PTS (GST_PAD_PROBE_INFO_BUFFER(info)) >= start_pos_ts) {
+                               GST_BUFFER_PTS (GST_PAD_PROBE_INFO_BUFFER(info)) -= start_pos_ts;
+                       } else {
+                               /* If input buffer time is less than start position,
+                                * input buffer will be dropped.
+                                */
+                               return GST_PAD_PROBE_DROP;
+                       }
+
                }
        }
        return GST_PAD_PROBE_OK;