Commit 998534a2 authored by David Corvoysier's avatar David Corvoysier Committed by Sebastian Dröge

isomp4: Allow duration queries to be forwarded upstream

When receiving a duration query for TIME format, try to query upstream, and only if upstream fails fall back to qtdemux duration handling.
parent 6d158775
......@@ -720,12 +720,16 @@ gst_qtdemux_handle_src_query (GstPad * pad, GstObject * parent,
gst_query_parse_duration (query, &fmt, NULL);
if (fmt == GST_FORMAT_TIME) {
gint64 duration = -1;
gst_qtdemux_get_duration (qtdemux, &duration);
if (duration > 0) {
gst_query_set_duration (query, GST_FORMAT_TIME, duration);
res = TRUE;
/* First try to query upstream */
res = gst_pad_query_default (pad, parent, query);
if (!res) {
gint64 duration = -1;
gst_qtdemux_get_duration (qtdemux, &duration);
if (duration > 0) {
gst_query_set_duration (query, GST_FORMAT_TIME, duration);
res = TRUE;
}
}
}
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment