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.
This commit is contained in:
David Corvoysier 2012-06-28 11:47:20 +02:00 committed by Sebastian Dröge
parent 6d158775bb
commit 998534a2a1

View file

@ -720,12 +720,16 @@ gst_qtdemux_handle_src_query (GstPad * pad, GstObject * parent,
gst_query_parse_duration (query, &fmt, NULL); gst_query_parse_duration (query, &fmt, NULL);
if (fmt == GST_FORMAT_TIME) { if (fmt == GST_FORMAT_TIME) {
gint64 duration = -1; /* First try to query upstream */
res = gst_pad_query_default (pad, parent, query);
if (!res) {
gint64 duration = -1;
gst_qtdemux_get_duration (qtdemux, &duration); gst_qtdemux_get_duration (qtdemux, &duration);
if (duration > 0) { if (duration > 0) {
gst_query_set_duration (query, GST_FORMAT_TIME, duration); gst_query_set_duration (query, GST_FORMAT_TIME, duration);
res = TRUE; res = TRUE;
}
} }
} }
break; break;