GNOME Bugzilla – Bug 701185
rtsp-media: duration is used as range end point
Last modified: 2014-02-25 22:28:21 UTC
Created attachment 245538 [details] [review] rtsp-media: duration is used as range end point The attached suggested patch corrects a problem with RTSP ranges in-rtsp-media.c: that the result from the duration query is used as range end point. The patch calculates the end point as start point + duration.
This patch is not correct. In GStreamer, position is always between 0 and duration so media plays from the current position to the duration. Your patch assumes that duration means 'remaining playing time' but that's not correct.
OK. I'm trying to understand how duration queries work for handling RTSP ranges. Is duration updated after a seek? I think it should for GstRTSPMedia's seeks to result in correct ranges. But for GstMatroskaDemux, which we use in our pipeline, the duration does not seem to change after a seek. Looking in gstflvdemux.c's gst_flv_demux_loop, it looks like playback stops at segment stop after a seek, not at the duration. Could you help me sort this out?
(In reply to comment #2) > OK. I'm trying to understand how duration queries work for handling RTSP > ranges. Is duration updated after a seek? No, duration is constant for a file. > I think it should for GstRTSPMedia's > seeks to result in correct ranges. But for GstMatroskaDemux, which we use in > our pipeline, the duration does not seem to change after a seek. Correct, it is constant for a file. You can seek between 0 and the duration of the file. > Looking in > gstflvdemux.c's gst_flv_demux_loop, it looks like playback stops at segment > stop after a seek, not at the duration. segment.stop is where the user wanted to stop playback, which can be different than the duration of the file. > > Could you help me sort this out? a file goes from 0 -> duration playback goes from start to stop (with start and stop between 0 and duration)
(In reply to comment #3) > a file goes from 0 -> duration > playback goes from start to stop (with start and stop between 0 and duration) Thank you very much for these clarifications. Then GstRTSPMedia doesn't use the correct method for determining the RTSP range after a seek. It does a duration query in collect_media_stats. Is it possible to query the pipeline for the value of stop? (A position query is used for start)
Created attachment 246608 [details] [review] media: segment queries in collect_media_stats Here is a patch where segment queries are used instead of position and duration queries. From gst_query_new_segment docs: "A segment query is used to discover information about the currently configured segment for playback."
Created attachment 247245 [details] [review] media: use segment stop in collect_media_stats After discussion on the #gstreamer channel, changed so the range is between position and segment stop.
commit 52eb796bec687faa8d0f4c221cb989cd68574543 Author: David Svensson Fors <davidsf@axis.com> Date: Tue Jun 11 15:28:32 2013 +0200 media: use segment stop in collect_media_stats Use segment stop instead of duration as range end point. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=701185