mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
mxfdemux: Include duration in response to SEEKING query
This commit is contained in:
parent
1069330f76
commit
af6db6861e
1 changed files with 8 additions and 2 deletions
|
@ -4011,6 +4011,7 @@ gst_mxf_demux_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
||||||
}
|
}
|
||||||
case GST_QUERY_SEEKING:{
|
case GST_QUERY_SEEKING:{
|
||||||
GstFormat fmt;
|
GstFormat fmt;
|
||||||
|
gint64 duration;
|
||||||
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL);
|
gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL);
|
||||||
|
@ -4019,8 +4020,13 @@ gst_mxf_demux_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!gst_pad_query_duration (pad, GST_FORMAT_TIME, &duration)) {
|
||||||
|
gst_query_set_seeking (query, fmt, FALSE, -1, -1);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
if (demux->random_access) {
|
if (demux->random_access) {
|
||||||
gst_query_set_seeking (query, GST_FORMAT_TIME, TRUE, 0, -1);
|
gst_query_set_seeking (query, GST_FORMAT_TIME, TRUE, 0, duration);
|
||||||
} else {
|
} else {
|
||||||
GstQuery *peerquery = gst_query_new_seeking (GST_FORMAT_BYTES);
|
GstQuery *peerquery = gst_query_new_seeking (GST_FORMAT_BYTES);
|
||||||
gboolean seekable;
|
gboolean seekable;
|
||||||
|
@ -4029,7 +4035,7 @@ gst_mxf_demux_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
||||||
if (seekable)
|
if (seekable)
|
||||||
gst_query_parse_seeking (peerquery, NULL, &seekable, NULL, NULL);
|
gst_query_parse_seeking (peerquery, NULL, &seekable, NULL, NULL);
|
||||||
if (seekable)
|
if (seekable)
|
||||||
gst_query_set_seeking (query, GST_FORMAT_TIME, TRUE, 0, -1);
|
gst_query_set_seeking (query, GST_FORMAT_TIME, TRUE, 0, duration);
|
||||||
else
|
else
|
||||||
gst_query_set_seeking (query, GST_FORMAT_TIME, FALSE, -1, -1);
|
gst_query_set_seeking (query, GST_FORMAT_TIME, FALSE, -1, -1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue