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 701185 - rtsp-media: duration is used as range end point
rtsp-media: duration is used as range end point
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
git master
Other Linux
: Normal normal
: 1.2.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-05-29 10:07 UTC by David Svensson Fors
Modified: 2014-02-25 22:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rtsp-media: duration is used as range end point (1.25 KB, patch)
2013-05-29 10:07 UTC, David Svensson Fors
none Details | Review
media: segment queries in collect_media_stats (2.83 KB, patch)
2013-06-12 11:09 UTC, David Svensson Fors
none Details | Review
media: use segment stop in collect_media_stats (2.51 KB, patch)
2013-06-19 09:39 UTC, David Svensson Fors
none Details | Review

Description David Svensson Fors 2013-05-29 10:07:51 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.
Comment 1 Wim Taymans 2013-05-30 04:02:03 UTC
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.
Comment 2 David Svensson Fors 2013-06-07 11:28:14 UTC
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?
Comment 3 Wim Taymans 2013-06-07 11:34:27 UTC
(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)
Comment 4 David Svensson Fors 2013-06-10 05:56:56 UTC
(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)
Comment 5 David Svensson Fors 2013-06-12 11:09:34 UTC
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."
Comment 6 David Svensson Fors 2013-06-19 09:39:22 UTC
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.
Comment 7 Wim Taymans 2013-06-20 08:18:07 UTC
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