[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Wed Apr 7 23:56:56 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 0bf3ab11eba01d7bb937d9bdc3af7e639837850b
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 25 15:59:05 2009 +0000

    2009-11-25  Philippe Normand  <pnormand at igalia.com>
    
            Reviewed by Eric Seidel.
    
            [GTK] use gst_init_check() instead of gst_init()
            https://bugs.webkit.org/show_bug.cgi?id=31864
    
            Use gst_init_check() instead of gst_init() to prevent eventual
            unexpected exit of the application.
    
            * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
            (WebCore::do_gst_init):
            (WebCore::MediaPlayerPrivate::isAvailable):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51382 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 96120c5..342466b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2009-11-25  Philippe Normand  <pnormand at igalia.com>
+
+        Reviewed by Eric Seidel.
+
+        [GTK] use gst_init_check() instead of gst_init()
+        https://bugs.webkit.org/show_bug.cgi?id=31864
+
+        Use gst_init_check() instead of gst_init() to prevent eventual
+        unexpected exit of the application.
+
+        * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::do_gst_init):
+        (WebCore::MediaPlayerPrivate::isAvailable):
+
 2009-11-25  Gustavo Noronha Silva  <gustavo.noronha at collabora.co.uk>
 
         Reviewed by Xan Lopez.
diff --git a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
index b325d8c..c0242a1 100644
--- a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
+++ b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
@@ -146,21 +146,28 @@ void MediaPlayerPrivate::registerMediaEngine(MediaEngineRegistrar registrar)
 
 static bool gstInitialized = false;
 
-static void do_gst_init()
+static bool do_gst_init()
 {
     // FIXME: We should pass the arguments from the command line
     if (!gstInitialized) {
-        gst_init(0, 0);
-        gstInitialized = true;
-        gst_element_register(0, "webkitmediasrc", GST_RANK_PRIMARY,
-                             WEBKIT_TYPE_DATA_SRC);
+        GOwnPtr<GError> error;
+        gstInitialized = gst_init_check(0, 0, &error.outPtr());
+        if (!gstInitialized)
+            LOG_VERBOSE(Media, "Could not initialize GStreamer: %s",
+                        error ? error->message : "unknown error occurred");
+        else
+            gst_element_register(0, "webkitmediasrc", GST_RANK_PRIMARY,
+                                 WEBKIT_TYPE_DATA_SRC);
 
     }
+    return gstInitialized;
 }
 
 bool MediaPlayerPrivate::isAvailable()
 {
-    do_gst_init();
+    if (!do_gst_init())
+        return false;
+
     GstElementFactory* factory = gst_element_factory_find("playbin2");
     if (factory) {
         gst_object_unref(GST_OBJECT(factory));

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list