From ec19c9b6e45e857a54092cac939675e9faabf592 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 5 Nov 2014 13:45:29 +0100 Subject: [PATCH] asfdemux: Send duration query upstream first An upstream element (like mms or some dlna source) might be able to answer the query. Try that first, else fallback to standard logic --- gst/asfdemux/gstasfdemux.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c index 7eb3f2d..1a4c26d 100644 --- a/gst/asfdemux/gstasfdemux.c +++ b/gst/asfdemux/gstasfdemux.c @@ -4218,21 +4218,24 @@ gst_asf_demux_handle_src_query (GstPad * pad, GstObject * parent, break; } - GST_OBJECT_LOCK (demux); + res = gst_pad_query_default (pad, parent, query); + if (!res) { + GST_OBJECT_LOCK (demux); - if (demux->segment.duration != GST_CLOCK_TIME_NONE) { - GST_LOG ("returning duration: %" GST_TIME_FORMAT, - GST_TIME_ARGS (demux->segment.duration)); + if (demux->segment.duration != GST_CLOCK_TIME_NONE) { + GST_LOG ("returning duration: %" GST_TIME_FORMAT, + GST_TIME_ARGS (demux->segment.duration)); - gst_query_set_duration (query, GST_FORMAT_TIME, - demux->segment.duration); + gst_query_set_duration (query, GST_FORMAT_TIME, + demux->segment.duration); - res = TRUE; - } else { - GST_LOG ("duration not known yet"); - } + res = TRUE; + } else { + GST_LOG ("duration not known yet"); + } - GST_OBJECT_UNLOCK (demux); + GST_OBJECT_UNLOCK (demux); + } break; } -- 2.7.4