diff options
author | Matthew Waters <matthew@centricular.com> | 2017-03-14 16:49:25 +1100 |
---|---|---|
committer | Matthew Waters <matthew@centricular.com> | 2017-03-14 16:50:30 +1100 |
commit | fd8d35298f212487d54b50b3534326a316668ebc (patch) | |
tree | 6f56439beabe7442ad01a0d5f7ef8859e6ef2f22 /gst-libs | |
parent | efc015f27deca351e4f7cca1ebf6bc23bad6fd71 (diff) | |
download | gstreamer-plugins-bad-fd8d35298f212487d54b50b3534326a316668ebc.tar.gz |
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
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/adaptivedemux/gstadaptivedemux.c | 12 | ||||
-rw-r--r-- | gst-libs/gst/adaptivedemux/gstadaptivedemux.h | 12 |
2 files changed, 6 insertions, 18 deletions
diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c index 0ffb5307b..e46dc3a4b 100644 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c @@ -1748,12 +1748,12 @@ gst_adaptive_demux_src_query (GstPad * pad, GstObject * parent, GST_MANIFEST_LOCK (demux); if (fmt == GST_FORMAT_TIME && demux->priv->have_manifest) { - if (gst_adaptive_demux_is_live (demux)) - duration = GST_CLOCK_TIME_NONE; - else - duration = demux_class->get_duration (demux); - gst_query_set_duration (query, GST_FORMAT_TIME, duration); - ret = TRUE; + duration = demux_class->get_duration (demux); + + if (GST_CLOCK_TIME_IS_VALID (duration) && duration > 0) { + gst_query_set_duration (query, GST_FORMAT_TIME, duration); + ret = TRUE; + } } GST_MANIFEST_UNLOCK (demux); diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.h b/gst-libs/gst/adaptivedemux/gstadaptivedemux.h index d2d2f01ec..830171467 100644 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.h +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.h @@ -293,18 +293,6 @@ struct _GstAdaptiveDemuxClass GstFlowReturn (*update_manifest_data) (GstAdaptiveDemux * demux, GstBuffer * buf); gboolean (*is_live) (GstAdaptiveDemux * demux); - - /** - * get_duration: - * @demux: #GstAdaptiveDemux - * - * For non-live streams, this will be called to query the duration of the - * stream. - * - * Returns: The duration of the stream, or #GST_CLOCK_TIME_NONE if the - * duration is unknown - * Since: 1.6 - */ GstClockTime (*get_duration) (GstAdaptiveDemux * demux); /** |