summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAlex Ashley <bugzilla@ashley-family.net>2016-02-05 12:44:23 +0000
committerSebastian Dröge <sebastian@centricular.com>2017-03-02 19:54:04 +0200
commite1b68d9a65ba512a52c3a2b298fa830a445eb451 (patch)
treee8aa130ceb1fe06b33d03a10cdf38066229aaa4d /ext
parentb2e9891f8a06b07fad61204bda5b814a2ad5ef88 (diff)
downloadgstreamer-plugins-bad-e1b68d9a65ba512a52c3a2b298fa830a445eb451.tar.gz
adaptivedemux: answer duration queries for live streams
For duration queries on live streams, adaptivedemux ignores the query. The problem then is that the query is answered by the downstream qtdemux element, with the duration of the currently passing fragment. This commit changes the behaviour of adaptivedemux to answer the duration queries for live streams, returning GST_CLOCK_TIME_NONE. https://bugzilla.gnome.org/show_bug.cgi?id=753879
Diffstat (limited to 'ext')
-rw-r--r--ext/dash/gstmpdparser.c14
-rw-r--r--ext/hls/m3u8.c6
-rw-r--r--ext/smoothstreaming/gstmssmanifest.c2
3 files changed, 6 insertions, 16 deletions
diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c
index baf5dbc83..25eaab7d5 100644
--- a/ext/dash/gstmpdparser.c
+++ b/ext/dash/gstmpdparser.c
@@ -5483,18 +5483,12 @@ gst_mpd_client_get_next_fragment_duration (GstMpdClient * client,
GstClockTime
gst_mpd_client_get_media_presentation_duration (GstMpdClient * client)
{
- GstClockTime duration;
-
g_return_val_if_fail (client != NULL, GST_CLOCK_TIME_NONE);
- if (client->mpd_node->mediaPresentationDuration != -1) {
- duration = client->mpd_node->mediaPresentationDuration * GST_MSECOND;
- } else {
- /* We can only get the duration for on-demand streams */
- duration = GST_CLOCK_TIME_NONE;
- }
-
- return duration;
+ /* Note: adaptivedemux makes sure we only get duration queries for on-demand streams */
+ g_return_val_if_fail (client->mpd_node->mediaPresentationDuration != -1,
+ GST_CLOCK_TIME_NONE);
+ return client->mpd_node->mediaPresentationDuration * GST_MSECOND;
}
gboolean
diff --git a/ext/hls/m3u8.c b/ext/hls/m3u8.c
index 6cc7a715c..3bac7bfaa 100644
--- a/ext/hls/m3u8.c
+++ b/ext/hls/m3u8.c
@@ -1015,9 +1015,7 @@ gst_m3u8_get_duration (GstM3U8 * m3u8)
GST_M3U8_LOCK (m3u8);
- /* We can only get the duration for on-demand streams */
- if (!m3u8->endlist)
- goto out;
+ /* Note: adaptivedemux makes sure we only get duration queries for on-demand streams */
if (!GST_CLOCK_TIME_IS_VALID (m3u8->duration) && m3u8->files != NULL) {
GList *f;
@@ -1028,8 +1026,6 @@ gst_m3u8_get_duration (GstM3U8 * m3u8)
}
duration = m3u8->duration;
-out:
-
GST_M3U8_UNLOCK (m3u8);
return duration;
diff --git a/ext/smoothstreaming/gstmssmanifest.c b/ext/smoothstreaming/gstmssmanifest.c
index 7ef11140e..111fb7840 100644
--- a/ext/smoothstreaming/gstmssmanifest.c
+++ b/ext/smoothstreaming/gstmssmanifest.c
@@ -934,7 +934,7 @@ guint64
gst_mss_manifest_get_duration (GstMssManifest * manifest)
{
gchar *duration;
- guint64 dur = -1;
+ guint64 dur = GST_CLOCK_TIME_NONE;
/* try the property */
duration =