From 475abd15b6401131d0b2c2d32f608625de440571 Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Tue, 23 Aug 2011 01:54:26 +0000 Subject: [PATCH] hlsdemux: Implement the GST_QUERY_SEEKING properly --- gst/hls/gsthlsdemux.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gst/hls/gsthlsdemux.c b/gst/hls/gsthlsdemux.c index fc6e9d55eb..9c255dad6a 100644 --- a/gst/hls/gsthlsdemux.c +++ b/gst/hls/gsthlsdemux.c @@ -430,18 +430,24 @@ gst_hls_demux_src_query (GstPad * pad, GstQuery * query) break; case GST_QUERY_SEEKING:{ GstFormat fmt; - gint stop = -1; + gint64 stop = -1; gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL); + GST_INFO_OBJECT (hlsdemux, "Received GST_QUERY_SEEKING with format %d", + fmt); 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, + !gst_m3u8_client_is_live (hlsdemux->client), 0, stop); + ret = TRUE; + GST_INFO_OBJECT (hlsdemux, "GST_QUERY_SEEKING returning with stop : %" + GST_TIME_FORMAT, GST_TIME_ARGS (stop)); } - gst_query_set_seeking (query, fmt, FALSE, 0, stop); - ret = TRUE; break; } default: