[mistelix] No need to call run_pipeline for media dectection



commit 73090ab712ea7b33121def7e1bdf6b38a7659319
Author: Jordi Mas <jmas softcatala org>
Date:   Sat May 9 17:22:42 2009 +0200

    No need to call run_pipeline for media dectection
---
 libmistelix/mistelix.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libmistelix/mistelix.c b/libmistelix/mistelix.c
index 9b974bf..6af17e8 100644
--- a/libmistelix/mistelix.c
+++ b/libmistelix/mistelix.c
@@ -471,7 +471,6 @@ mistelix_detect_media (const char* file, char* media)
 
 	pipe = gst_pipeline_new ("pipe");
 	bus = gst_pipeline_get_bus (GST_PIPELINE (pipe));
-//	gst_bus_add_watch (bus, cb_typefound, (gpointer) media_type);
 	gst_object_unref (bus);
 
 	// create file source and typefind element
@@ -483,9 +482,10 @@ mistelix_detect_media (const char* file, char* media)
 
 	gst_bin_add_many (GST_BIN (pipe), filesrc, typefind, fakesink, NULL);
 	gst_element_link_many (filesrc, typefind, fakesink, NULL);
-	gst_element_set_state (GST_ELEMENT (pipe), GST_STATE_PLAYING);
 
-	run_pipeline (pipe);
+	gst_element_set_state (GST_ELEMENT (pipe), GST_STATE_PLAYING);
+	/* Wait for status change */
+	gst_element_get_state (pipe, NULL, NULL, SEEK_TIMEOUT);
 
 	gst_element_set_state (GST_ELEMENT (pipe), GST_STATE_NULL);
 	gst_object_unref (GST_OBJECT (pipe));



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