After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 659808 - matroskademux: misc fixes
matroskademux: misc fixes
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
unspecified
Other All
: Normal normal
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-09-22 09:53 UTC by Vincent Penquerc'h
Modified: 2011-10-05 13:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
matroskademux: position query is in stream time (1.04 KB, patch)
2011-09-22 09:53 UTC, Vincent Penquerc'h
none Details | Review
matroskademux: fix first segment not heeding first ts (1.66 KB, patch)
2011-09-22 09:53 UTC, Vincent Penquerc'h
none Details | Review
matroskademux: fix streams that do not start at 0 (1.40 KB, patch)
2011-09-22 09:53 UTC, Vincent Penquerc'h
none Details | Review
matroskademux: more fixes for seeking in files with a non zero start (5.98 KB, patch)
2011-09-23 11:53 UTC, Vincent Penquerc'h
none Details | Review

Description Vincent Penquerc'h 2011-09-22 09:53:19 UTC
matroskademux: misc fixes
Comment 1 Vincent Penquerc'h 2011-09-22 09:53:21 UTC
Created attachment 197223 [details] [review]
matroskademux: position query is in stream time
Comment 2 Vincent Penquerc'h 2011-09-22 09:53:24 UTC
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.
Comment 3 Vincent Penquerc'h 2011-09-22 09:53:27 UTC
Created attachment 197225 [details] [review]
matroskademux: fix streams that do not start at 0
Comment 4 Mark Nauwelaerts 2011-09-22 09:57:10 UTC
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.
Comment 5 Christian Fredrik Kalager Schaller 2011-09-22 10:22:04 UTC
Tested these patches, transcoded webm files now play for me in Totem.
Comment 6 Vincent Penquerc'h 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);
   }
Comment 7 Vincent Penquerc'h 2011-09-22 11:01:20 UTC
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
Comment 8 Vincent Penquerc'h 2011-09-23 11:53:39 UTC
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.
Comment 9 Mark Nauwelaerts 2011-10-05 13:06:05 UTC
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