mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
hlsdemux: fix DURATION query handling
Only answer duration queries in TIME format with a duration in seconds. Make sure we don't return GST_CLOCK_TIME_NONE as duration (which is non-0, but still invalid/useless).
This commit is contained in:
parent
0d9dbd4c0f
commit
7ec71fb446
1 changed files with 8 additions and 4 deletions
|
@ -406,12 +406,16 @@ gst_hls_demux_src_query (GstPad * pad, GstQuery * query)
|
|||
switch (query->type) {
|
||||
case GST_QUERY_DURATION:{
|
||||
GstClockTime duration;
|
||||
GstFormat fmt;
|
||||
|
||||
gst_query_parse_duration (query, &fmt, NULL);
|
||||
if (fmt == GST_FORMAT_TIME) {
|
||||
duration = gst_m3u8_client_get_duration (hlsdemux->client);
|
||||
if (duration) {
|
||||
if (GST_CLOCK_TIME_IS_VALID (duration) && duration > 0) {
|
||||
gst_query_set_duration (query, GST_FORMAT_TIME, duration);
|
||||
ret = TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GST_QUERY_URI:
|
||||
|
|
Loading…
Reference in a new issue