hlsdemux: implement SEEKING query
This commit is contained in:
parent
67c6b53ec4
commit
0d9dbd4c0f
@ -422,9 +422,25 @@ gst_hls_demux_src_query (GstPad * pad, GstQuery * query)
|
|||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
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:
|
default:
|
||||||
/* Don't fordward queries upstream because of the special nature of this
|
/* 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 */
|
* first playlist */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user