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 753879 - adaptivedemux: doesn't answer duration queries for live streams
adaptivedemux: doesn't answer duration queries for live streams
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-08-20 13:32 UTC by mariuszb
Modified: 2018-11-03 13:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
adaptivedemux: answer duration queries for live streams (4.48 KB, patch)
2016-02-05 12:53 UTC, A Ashley
none Details | Review
adaptivedemux: answer duration queries for live streams (5.60 KB, patch)
2016-03-11 14:29 UTC, A Ashley
committed Details | Review

Description mariuszb 2015-08-20 13:32:40 UTC
For duration queries on live streams adaptivedemux ignores the query. The problem then is that the query is answered by qtdemux downstream for with the values valid for the currently passing fragment.

I think adaptivedemux should be the final authority on stream duration and should return valid duration with GST_CLOCK_TIME_NONE set as a value for live streams.
Comment 1 Sebastian Dröge (slomo) 2015-08-20 13:44:55 UTC
Sounds reasonable
Comment 2 Thiago Sousa Santos 2016-02-04 18:16:36 UTC
@reporter: Are you willing to provide a patch?
Comment 3 A Ashley 2016-02-05 12:53:36 UTC
Created attachment 320497 [details] [review]
adaptivedemux: answer duration queries for live streams

This patch changes the behaviour of adaptivedemux to pass the duration query to the class that extends from GstAdaptiveDemux. These classes can then choose the most appropriate response.
Comment 4 Thiago Sousa Santos 2016-02-11 19:00:34 UTC
Review of attachment 320497 [details] [review]:

I think all 3 elements would reply the same. So I'd prefer to just handle it in the base class. If it is live, just set it to NONE and reply true to the query.
Comment 5 A Ashley 2016-02-12 11:43:03 UTC
The reason I didn't make adaptive demux reply to duration queries was because:
1. I wasn't sure if there will ever be a class extending from adaptive demux that would would want to reply with a duration
2. Most of the classes extending from adaptive demux were checking for live as a special case

I'm happy to take your approach of replying from adaptive demux, but in that case I think the code to check for if live should be removed from hlsdemux and dashdemx, and the API documentation should be changed to indicate that get_duration() will never be called for a live stream.
Comment 6 Thiago Sousa Santos 2016-02-12 22:47:02 UTC
adaptivedemux is not public API so we can change as much as we need. So far we have no plans on extending it to new formats, I'm only aware of HDS from Adobe but the spec is a bit vague and I don't think it is adopted much.

So far I haven't seen any of the 3 allow knowing the duration of a live stream so I'm more in favor of the simpler approach of handling it in the base class and removing live checks for subclasses, might want to leave a g_return_if_fail for catching programing errors in the future.

If someone ever implements knowing durations of live streams (live transmissions with predefined ending time?) we can change this again, no problem.
Comment 7 A Ashley 2016-03-11 14:29:04 UTC
Created attachment 323715 [details] [review]
adaptivedemux: answer duration queries for live streams

This patch changes the behaviour of adaptivedemux to answer the duration queries for live streams, returning GST_CLOCK_TIME_NONE.
Comment 8 A Ashley 2016-03-11 14:31:33 UTC
The title of this ticket should probably be changed to "adaptivedemux: doesn't answer duration queries for live streams" as we're only discussing duration queries.
Comment 9 Sebastian Dröge (slomo) 2017-03-02 17:54:42 UTC
Attachment 323715 [details] pushed as e1b68d9 - adaptivedemux: answer duration queries for live streams
Comment 10 Matthew Waters (ystreet00) 2017-03-14 02:53:24 UTC
This entirely breaks duration reporting for recorded live streams. i.e. a stream that is always available in the past but is also being streamed live.
Comment 11 Matthew Waters (ystreet00) 2017-03-14 02:55:17 UTC
i.e. mss streams with live=true and DVRWindowLength=0
Comment 12 Matthew Waters (ystreet00) 2017-03-14 05:52:26 UTC
I've pushed a revert.

commit fd8d35298f212487d54b50b3534326a316668ebc
Author: Matthew Waters <matthew@centricular.com>
Date:   Tue Mar 14 16:49:25 2017 +1100

    Revert "adaptivedemux: answer duration queries for live streams"
    
    Completely disabling duration reporting with live streams is not cool.
    
    This reverts commit e1b68d9a65ba512a52c3a2b298fa830a445eb451.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753879
Comment 13 GStreamer system administrator 2018-11-03 13:39:32 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/292.