Commit 64cb3868 authored by Víctor Manuel Jáquez Leal's avatar Víctor Manuel Jáquez Leal Committed by GStreamer Marge Bot
Browse files

matroskademux: Handle element's duration query.

This is small regression from commit f7abd81a.

When calling `gst_element_query()` no pad is associated with that query, but the
current code always forwards the query to the associated pad, which is NULL in
previous case. This patch checks for the pad before forwarding the query.

Part-of: <!3404>
parent 45289009
Pipeline #737690 waiting for manual action with stages
in 5 minutes and 11 seconds
......@@ -1839,9 +1839,10 @@ gst_matroska_demux_query (GstMatroskaDemux * demux, GstPad * pad,
gst_query_parse_duration (query, &format, NULL);
res = TRUE;
if (format == GST_FORMAT_TIME) {
res = gst_pad_query_default (pad, GST_OBJECT_CAST (demux), query);
res = FALSE;
if (pad)
res = gst_pad_query_default (pad, GST_OBJECT_CAST (demux), query);
if (!res) {
GST_OBJECT_LOCK (demux);
gst_query_set_duration (query, GST_FORMAT_TIME,
......@@ -1852,6 +1853,8 @@ gst_matroska_demux_query (GstMatroskaDemux * demux, GstPad * pad,
}
} else if (format == GST_FORMAT_DEFAULT && context
&& context->default_duration) {
res = TRUE;
GST_OBJECT_LOCK (demux);
gst_query_set_duration (query, GST_FORMAT_DEFAULT,
demux->common.segment.duration / context->default_duration);
......
Supports Markdown
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