[gst-cvs] gst-plugins-bad: inputselector: Use the start time (i.e. timestamp) as the last stop

Sebastian Dröge slomo at kemper.freedesktop.org
Mon Nov 9 02:50:06 PST 2009


Module: gst-plugins-bad
Branch: master
Commit: 729c62263f79c73fe36de1b988734f7735eaa1c5
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=729c62263f79c73fe36de1b988734f7735eaa1c5

Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date:   Mon Nov  9 11:48:00 2009 +0100

inputselector: Use the start time (i.e. timestamp) as the last stop

Using the end time makes it impossible to replace buffers, which is
a big problem for subtitles that could have very long durations.

Merged from gst-plugins-base, 27034be4611231cc55fa3d3e253baa40c6bff41d.

---

 gst/selector/gstinputselector.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gst/selector/gstinputselector.c b/gst/selector/gstinputselector.c
index 3fa22b0..0929cdf 100644
--- a/gst/selector/gstinputselector.c
+++ b/gst/selector/gstinputselector.c
@@ -557,7 +557,7 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
   GstPad *active_sinkpad;
   GstPad *prev_active_sinkpad;
   GstSelectorPad *selpad;
-  GstClockTime end_time, duration;
+  GstClockTime start_time, end_time, duration;
   GstSegment *seg;
   GstEvent *close_event = NULL, *start_event = NULL;
   GstCaps *caps;
@@ -577,10 +577,10 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
   active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad);
 
   /* update the segment on the srcpad */
-  end_time = GST_BUFFER_TIMESTAMP (buf);
-  if (GST_CLOCK_TIME_IS_VALID (end_time)) {
+  start_time = GST_BUFFER_TIMESTAMP (buf);
+  if (GST_CLOCK_TIME_IS_VALID (start_time)) {
     GST_DEBUG_OBJECT (pad, "received start time %" GST_TIME_FORMAT,
-        GST_TIME_ARGS (end_time));
+        GST_TIME_ARGS (start_time));
     duration = GST_BUFFER_DURATION (buf);
     if (GST_CLOCK_TIME_IS_VALID (duration))
       end_time += duration;
@@ -588,7 +588,7 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
         GST_TIME_ARGS (end_time));
 
     GST_OBJECT_LOCK (pad);
-    gst_segment_set_last_stop (seg, seg->format, end_time);
+    gst_segment_set_last_stop (seg, seg->format, start_time);
     GST_OBJECT_UNLOCK (pad);
   }
 





More information about the Gstreamer-commits mailing list