mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 18:35:35 +00:00
baseparse: use determined seekability in answering SEEKING query
This commit is contained in:
parent
3f02dbd3ab
commit
1a54736255
1 changed files with 3 additions and 13 deletions
|
@ -2485,23 +2485,13 @@ gst_base_parse_query (GstPad * pad, GstQuery * query)
|
||||||
GST_LOG_OBJECT (parse, "upstream handled %d, seekable %d",
|
GST_LOG_OBJECT (parse, "upstream handled %d, seekable %d",
|
||||||
res, seekable);
|
res, seekable);
|
||||||
if (!(res && seekable)) {
|
if (!(res && seekable)) {
|
||||||
/* TODO maybe also check upstream provides proper duration ? */
|
|
||||||
seekable = TRUE;
|
|
||||||
if (!gst_base_parse_get_duration (parse, GST_FORMAT_TIME, &duration)
|
if (!gst_base_parse_get_duration (parse, GST_FORMAT_TIME, &duration)
|
||||||
|| duration == -1) {
|
|| duration == -1) {
|
||||||
seekable = FALSE;
|
seekable = FALSE;
|
||||||
} else {
|
} else {
|
||||||
GstQuery *q;
|
seekable = parse->priv->upstream_seekable;
|
||||||
|
GST_LOG_OBJECT (parse, "already determine upstream seekabled: %d",
|
||||||
q = gst_query_new_seeking (GST_FORMAT_BYTES);
|
seekable);
|
||||||
if (!gst_pad_peer_query (parse->sinkpad, q)) {
|
|
||||||
seekable = FALSE;
|
|
||||||
} else {
|
|
||||||
gst_query_parse_seeking (q, &fmt, &seekable, NULL, NULL);
|
|
||||||
}
|
|
||||||
GST_LOG_OBJECT (parse, "upstream BYTE handled %d, seekable %d",
|
|
||||||
res, seekable);
|
|
||||||
gst_query_unref (q);
|
|
||||||
}
|
}
|
||||||
gst_query_set_seeking (query, GST_FORMAT_TIME, seekable, 0, duration);
|
gst_query_set_seeking (query, GST_FORMAT_TIME, seekable, 0, duration);
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue