[ekiga] Use gst_init_check instead of gst_init to handle things more gracefully



commit 5e2d322fb64f07c69b14b5c63e059def5fe46268
Author: Julien Puydt <jpuydt gnome org>
Date:   Thu Jun 4 13:11:44 2009 +0200

    Use gst_init_check instead of gst_init to handle things more gracefully

 lib/engine/components/gstreamer/gst-main.cpp |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/lib/engine/components/gstreamer/gst-main.cpp b/lib/engine/components/gstreamer/gst-main.cpp
index 6e53192..5027ad5 100644
--- a/lib/engine/components/gstreamer/gst-main.cpp
+++ b/lib/engine/components/gstreamer/gst-main.cpp
@@ -61,16 +61,20 @@ gstreamer_init (Ekiga::ServiceCore& core,
 
   if (audioinput_core && audiooutput_core && videoinput_core) {
 
-    gst_init (argc, argv);
+    if (gst_init_check (argc, argv, NULL)) {
 
-    GST::VideoInputManager* video = new GST::VideoInputManager ();
-    GST::AudioInputManager* audioin = new GST::AudioInputManager ();
-    GST::AudioOutputManager* audioout = new GST::AudioOutputManager ();
+      GST::VideoInputManager* video = new GST::VideoInputManager ();
+      GST::AudioInputManager* audioin = new GST::AudioInputManager ();
+      GST::AudioOutputManager* audioout = new GST::AudioOutputManager ();
 
-    audioinput_core->add_manager (*audioin);
-    audiooutput_core->add_manager (*audioout);
-    videoinput_core->add_manager (*video);
-    result = true;
+      audioinput_core->add_manager (*audioin);
+      audiooutput_core->add_manager (*audioout);
+      videoinput_core->add_manager (*video);
+      result = true;
+    } else {
+
+      std::cout << "gst_init_check failed" << std::endl; // FIXME: remove
+    }
   }
 
   return result;



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