[tracker/tracker-0.6] Add a safeguard to freeing the pipeline in gstreamer extractor



commit 81cc59c4c132331d9a18b21ed6a509c50e9c5d43
Author: Mikael Ottela <mikael ottela ixonos com>
Date:   Fri Apr 24 11:53:57 2009 +0300

    Add a safeguard to freeing the pipeline in gstreamer extractor
    
    A safeguard has been added in gstreamer extractor to check that the pipeline
    is in NULL state before freeing it.
    
    Fixes NB#112393.
---
 src/tracker-extract/tracker-extract-gstreamer.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index 9e71d56..c537ce4 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -37,6 +37,9 @@
 #include "tracker-main.h"
 #include "tracker-extract-albumart.h"
 
+/* We wait this long (seconds) for NULL state before freeing */
+#define TRACKER_EXTRACT_GUARD_TIMEOUT 3
+
 /* An additional tag in gstreamer for the content source. Remove when in upstream */
 #ifndef GST_TAG_CLASSIFICATION
 #define GST_TAG_CLASSIFICATION "classification"
@@ -766,6 +769,7 @@ tracker_extract_gstreamer (const gchar *uri,
 	}
 
 	gst_element_set_state (extractor->pipeline, GST_STATE_NULL);
+	gst_element_get_state (extractor->pipeline, NULL, NULL, TRACKER_EXTRACT_GUARD_TIMEOUT* GST_SECOND);
 	gst_object_unref (extractor->bus);
 
 	if (extractor->tagcache) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]