From 0d9dbd4c0f1a50240fa1459df68ea7efc8dd26d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 3 May 2011 11:51:44 +0100 Subject: [PATCH] hlsdemux: implement SEEKING query --- gst/hls/gsthlsdemux.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/gst/hls/gsthlsdemux.c b/gst/hls/gsthlsdemux.c index 6dd779ac2b..c5644914df 100644 --- a/gst/hls/gsthlsdemux.c +++ b/gst/hls/gsthlsdemux.c @@ -422,9 +422,25 @@ gst_hls_demux_src_query (GstPad * pad, GstQuery * query) ret = TRUE; } break; + case GST_QUERY_SEEKING:{ + GstFormat fmt; + gint stop = -1; + + gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL); + if (fmt == GST_FORMAT_TIME) { + GstClockTime duration; + + duration = gst_m3u8_client_get_duration (hlsdemux->client); + if (GST_CLOCK_TIME_IS_VALID (duration) && duration > 0) + stop = duration; + } + gst_query_set_seeking (query, fmt, FALSE, 0, stop); + ret = TRUE; + break; + } default: /* Don't fordward queries upstream because of the special nature of this - * "demuxer", which relies on the upstream element only to be feed with the + * "demuxer", which relies on the upstream element only to be fed with the * first playlist */ break; }