mxfdemux: Include duration in response to SEEKING query

This commit is contained in:
Sebastian Dröge 2017-06-27 15:41:48 +03:00
parent 1069330f76
commit af6db6861e

View file

@ -4011,6 +4011,7 @@ gst_mxf_demux_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
}
case GST_QUERY_SEEKING:{
GstFormat fmt;
gint64 duration;
ret = TRUE;
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;
}
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) {
gst_query_set_seeking (query, GST_FORMAT_TIME, TRUE, 0, -1);
gst_query_set_seeking (query, GST_FORMAT_TIME, TRUE, 0, duration);
} else {
GstQuery *peerquery = gst_query_new_seeking (GST_FORMAT_BYTES);
gboolean seekable;
@ -4029,7 +4035,7 @@ gst_mxf_demux_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
if (seekable)
gst_query_parse_seeking (peerquery, NULL, &seekable, NULL, NULL);
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
gst_query_set_seeking (query, GST_FORMAT_TIME, FALSE, -1, -1);