GNOME Bugzilla – Bug 659808
matroskademux: misc fixes
Last modified: 2011-10-05 13:06:57 UTC
Created attachment 197223 [details] [review] matroskademux: position query is in stream time
Created attachment 197224 [details] [review] matroskademux: fix first segment not heeding first ts Instead of creating a new segment here, we just request a new one to be created whenever possible, which will be done when we get a buffer timestamp to base the start time on.
Created attachment 197225 [details] [review] matroskademux: fix streams that do not start at 0
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.
Tested these patches, transcoded webm files now play for me in Totem.
(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); }
11:53 < slomo> v: stop = MAX (stop, 0); should really be stop = MAX (stop, start); in your gstsegment.c patch if you want to make it consistent
Created attachment 197349 [details] [review] matroskademux: more fixes for seeking in files with a non zero start Segment start time moves with seeks, so keep the time offset elsewhere, and apply it where appropriate. The duration seems to stay untouched, so we still use it from the segment.
OK, so merged these patches into a single one, along with some fixes/modifications, though did not knick the credit (or blame) ;) commit be82dd8e3ab1599e2aad8c0301ff3841d9a36cb4 Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Date: Wed Sep 21 18:45:42 2011 +0100 matroskademux: improve segment handling with non-zero starting timestamp ... as well as related items, such as seeking and position reporting. https://bugzilla.gnome.org/show_bug.cgi?id=659808