summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@gnome.org>2014-07-30 15:23:39 +0200
committerThibault Saunier <tsaunier@gnome.org>2014-07-30 15:28:21 +0200
commit235e46207743bb487538081c5ed2746f96955f73 (patch)
tree7248f5dfb2fe0bb877ed8b6d1c956d5c3efabf01
parentcf50b45ff63718cb9918c91f778b3e48a4bcb345 (diff)
pbutils: discoverer: Always set the pipeline back to NULL after an error
Otherwize the pipeline would be in an wrong state and on the next iteration any kind of error could happen Everytime an error happens in a pipeline the application has to set the pipeline back to NULL instead of READY. https://bugzilla.gnome.org/show_bug.cgi?id=733976
-rw-r--r--gst-libs/gst/pbutils/gstdiscoverer.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gst-libs/gst/pbutils/gstdiscoverer.c b/gst-libs/gst/pbutils/gstdiscoverer.c
index 337cd3200..da650f3f9 100644
--- a/gst-libs/gst/pbutils/gstdiscoverer.c
+++ b/gst-libs/gst/pbutils/gstdiscoverer.c
@@ -1514,12 +1514,20 @@ discoverer_cleanup (GstDiscoverer * dc)
GST_DEBUG ("Cleaning up");
gst_bus_set_flushing (dc->priv->bus, TRUE);
+
+ DISCO_LOCK (dc);
+ if (dc->priv->current_error) {
+ g_error_free (dc->priv->current_error);
+ DISCO_UNLOCK (dc);
+ gst_element_set_state ((GstElement *) dc->priv->pipeline, GST_STATE_NULL);
+ } else {
+ DISCO_UNLOCK (dc);
+ }
+
gst_element_set_state ((GstElement *) dc->priv->pipeline, GST_STATE_READY);
gst_bus_set_flushing (dc->priv->bus, FALSE);
DISCO_LOCK (dc);
- if (dc->priv->current_error)
- g_error_free (dc->priv->current_error);
dc->priv->current_error = NULL;
if (dc->priv->current_topology) {
gst_structure_free (dc->priv->current_topology);