GNOME Bugzilla – Bug 753879
adaptivedemux: doesn't answer duration queries for live streams
Last modified: 2018-11-03 13:39:32 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.
Sounds reasonable
@reporter: Are you willing to provide a patch?
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.
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.
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.
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.
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.
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.
Attachment 323715 [details] pushed as e1b68d9 - adaptivedemux: answer duration queries for live streams
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.
i.e. mss streams with live=true and DVRWindowLength=0
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
-- 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.