From: Edward Hervey Date: Sat, 4 Nov 2017 18:48:13 +0000 (+0100) Subject: discoverer: Don't switch to PLAYING if we saw an error X-Git-Tag: 1.16.2~1021 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=89238f9de121ddb6680f9b195833c81ba254e3a4;p=platform%2Fupstream%2Fgst-plugins-base.git discoverer: Don't switch to PLAYING if we saw an error If we saw an error on the bus, we can't be guaranteed that element will function properly anyway. Avoids weird state change races also --- diff --git a/gst-libs/gst/pbutils/gstdiscoverer.c b/gst-libs/gst/pbutils/gstdiscoverer.c index 78b1399..48e7686 100644 --- a/gst-libs/gst/pbutils/gstdiscoverer.c +++ b/gst-libs/gst/pbutils/gstdiscoverer.c @@ -1312,8 +1312,10 @@ discoverer_collect (GstDiscoverer * dc) if (gst_element_query_duration (pipeline, GST_FORMAT_TIME, &dur)) { GST_DEBUG ("Got duration %" GST_TIME_FORMAT, GST_TIME_ARGS (dur)); dc->priv->current_info->duration = (guint64) dur; - } else { + } else if (dc->priv->current_info->result != GST_DISCOVERER_ERROR) { GstStateChangeReturn sret; + /* Note: We don't switch to PLAYING if we previously saw an ERROR since + * the state of various element isn't guaranteed anymore */ /* Some parsers may not even return a rough estimate right away, e.g. * because they've only processed a single frame so far, so if we