flvdemux: Query duration upstream first
authorEdward Hervey <bilboed@bilboed.com>
Thu, 5 Jun 2014 07:38:29 +0000 (09:38 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Thu, 5 Jun 2014 07:38:29 +0000 (09:38 +0200)
Upstream elements (like rtmpsrc) might be able to provide the duration
more accurately than flvdemux. Especially with index-less vod files

gst/flv/gstflvdemux.c

index d90069f..38c4f63 100644 (file)
@@ -3136,6 +3136,11 @@ gst_flv_demux_query (GstPad * pad, GstObject * parent, GstQuery * query)
     {
       GstFormat format;
 
+      /* Try to push upstream first */
+      res = gst_pad_peer_query (demux->sinkpad, query);
+      if (res)
+        goto beach;
+
       gst_query_parse_duration (query, &format, NULL);
 
       /* duration is time only */