GNOME Bugzilla – Bug 746822
qtdemux: segment query reports wrong values after key-unit seek
Last modified: 2015-04-22 17:06:39 UTC
This is a bit odd, and didn't yet investigate but I notice the stream duration is different after each seeks.
When doing key uint seek, qtdemux calls gst_qtdemux_adjust_seek to get proper offset. And then this offset is set to segment.position and segment.time in gst_qtdemux_perform_seek. After that, app sends segment query, qtdemux set start, stop to query. During this job, it gets new value from gst_segment_to_stream_time and sets them to query. For example, app seeks 0:00:53.229000 and it aligns to 0:00:50.000 by keyframe seek. And then app gets result of the query that has start=0:00:50.000, stop=0:00:59.721. app (rtsp-server) thinks of stop time as finish time. But real finish time is 0:01:02.95000 ( this gap is exactly same as one between start time and postion) At this moment, qtdemux->segment is like below. segment start=0:00:53.229000000, offset=0:00:00.000000000, stop=0:01:02.950000000, rate=1.000000, applied_rate=1.000000, flags=0x01, time=0:00:50.000000000, base=0:00:00.000000000, position 0:00:50.000000000, duration 0:01:02.950000000 As talk with Thiago, it is a bug of qt demuxer. Qt demuxer's segment.start is has to be updated after key-unit seek as like segment.time I'm working on this.
Created attachment 301244 [details] [review] qtdemux: Update segment.start after key-unit seek
Comment on attachment 301244 [details] [review] qtdemux: Update segment.start after key-unit seek >From a45462b941aea35fa9c909267255e26cb675a957 Mon Sep 17 00:00:00 2001 >From: Hyunjun <zzoon.ko@samsung.com> >Date: Fri, 10 Apr 2015 09:17:26 +0900 >Subject: [PATCH] qtdemux: Update segment.start after key-unit seek > >https://bugzilla.gnome.org/show_bug.cgi?id=746822 > >--- > gst/isomp4/qtdemux.c | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c >index 2279097..518f174 100644 >--- a/gst/isomp4/qtdemux.c >+++ b/gst/isomp4/qtdemux.c >@@ -1432,6 +1432,7 @@ gst_qtdemux_perform_seek (GstQTDemux * qtdemux, GstSegment * segment, > } > segment->position = desired_offset; > segment->time = desired_offset; >+ segment->start = desired_offset; > > /* we stop at the end */ > if (segment->stop == -1) >-- >2.1.0 >
Created attachment 301248 [details] [review] qtdemux: Update segment.start after key-unit seek
Created attachment 301253 [details] [review] qtdemux: Update segment.start after key-unit seek
Thanks for the patch, added a commit description and pushed. commit 7fbd1b472fd016ed3293a360123b1dd55bee18e4 Author: Hyunjun Ko <zzoon.ko@samsung.com> Date: Fri Apr 10 09:17:26 2015 +0900 qtdemux: Update segment.start after key-unit seek When doing key uint seek, qtdemux calls gst_qtdemux_adjust_seek to get proper offset. And then this offset is set to segment.position and segment.time in gst_qtdemux_perform_seek but segment.start is not updated. After that, application sends segment query, qtdemux sets start and stop to query using gst_segment_to_stream_time. Due to the wrong value in segment.start, the stop position is smaller than it should. https://bugzilla.gnome.org/show_bug.cgi?id=746822
Neat, thanks for fixing that !