[Bug 659808] matroskademux: misc fixes

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Thu Sep 22 03:45:18 PDT 2011


https://bugzilla.gnome.org/show_bug.cgi?id=659808
  GStreamer | gst-plugins-good | unspecified

--- Comment #6 from Vincent Penquerc'h <vincent.penquerch at collabora.co.uk> 2011-09-22 10:45:13 UTC ---
(In reply to comment #4)
> Did not look in detail, but wondering what is the problem being fixed here with
> newsegment ?  In particular, why is "it" not being handled by the gap handling
> code which is supposed to handle a jump from 0 to real possibly non-zero start.

AFAICS, gst_segment_set_seek works inside a 0..duration segment.
Changing it to handle start time (patch below) causes the segment test to fail,
and I can't quite decide if the test and code are right, or not.
The patch below would also fix the issue, but would need someone with in depth
knowledge of the segment semantics to look over it to see if it really is
correct. In particular, if all of start/stop/duration are specified, then the
segment is overspecified, and (if stop-start!=duration) which need adjusting
may have subtle effects I don't want to risk.


diff --git a/gst/gstsegment.c b/gst/gstsegment.c
index 0b090a3..04f907c 100644
--- a/gst/gstsegment.c
+++ b/gst/gstsegment.c
@@ -323,10 +323,7 @@ gst_segment_set_seek (GstSegment * segment, gdouble rate,
       break;
   }
   /* bring in sane range */
-  if (segment->duration != -1)
-    start = CLAMP (start, 0, segment->duration);
-  else
-    start = MAX (start, 0);
+  start = MAX (start, 0);

   /* stop can be -1 if we have not configured a stop. */
   switch (stop_type) {
@@ -362,7 +359,7 @@ gst_segment_set_seek (GstSegment * segment, gdouble rate,
   /* if we have a valid stop time, make sure it is clipped */
   if (stop != -1) {
     if (segment->duration != -1)
-      stop = CLAMP (stop, 0, segment->duration);
+      stop = CLAMP (stop, start, start + segment->duration);
     else
       stop = MAX (stop, 0);
   }

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list