Commit 9a0efd02 authored by Philippe Rouquier's avatar Philippe Rouquier

Fix #587284 – nautilus hangs every time

Make sure libbrasero-burn initializes itself the libraries it depends on so that anything linking to it doesn't have to do it itself.
parent 2fd0f5a6
......@@ -16,6 +16,7 @@ INCLUDES = \
$(BRASERO_GLIB_CFLAGS) \
$(BRASERO_GIO_CFLAGS) \
$(BRASERO_GTK_CFLAGS) \
$(BRASERO_GSTREAMER_CFLAGS) \
$(BRASERO_DBUS_CFLAGS)
GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
......@@ -63,8 +64,8 @@ libbrasero_burn_la_LIBADD = \
$(BRASERO_GIO_LIBS) \
$(BRASERO_GCONF_LIBS) \
$(BRASERO_GTK_LIBS) \
$(BRASERO_DBUS_LIBS) \
-lm
$(BRASERO_GSTREAMER_LIBS) \
$(BRASERO_DBUS_LIBS)
libbrasero_burn_la_LDFLAGS = \
-version-info $(LIBBRASERO_LT_VERSION) \
......
......@@ -58,7 +58,8 @@ G_BEGIN_DECLS
*/
gboolean
brasero_burn_library_start (void);
brasero_burn_library_start (int *argc,
char **argv []);
void
brasero_burn_library_stop (void);
......
......@@ -39,6 +39,9 @@
#include <gconf/gconf-client.h>
#include <gst/gst.h>
#include <gst/pbutils/pbutils.h>
#include "brasero-io.h"
#include "burn-basics.h"
......@@ -201,7 +204,8 @@ brasero_caps_list_dump (void)
}
gboolean
brasero_burn_library_start (void)
brasero_burn_library_start (int *argc,
char **argv [])
{
GConfClient *client;
......@@ -210,6 +214,17 @@ brasero_burn_library_start (void)
BRASERO_MINOR_VERSION,
BRASERO_SUB);
/* Initialize external libraries (threads... */
if (!g_thread_supported ())
g_thread_init (NULL);
/* ... and Gstreamer) */
if (!gst_init_check (argc, argv, NULL))
return FALSE;
/* This is for missing codec automatic install */
gst_pb_utils_init ();
/* preload some gconf keys */
client = gconf_client_get_default ();
gconf_client_add_dir (client,
......@@ -244,6 +259,8 @@ brasero_burn_library_get_plugins_list (void)
void
brasero_burn_library_stop (void)
{
GConfClient *client;
if (plugin_manager) {
g_object_unref (plugin_manager);
plugin_manager = NULL;
......@@ -257,8 +274,8 @@ brasero_burn_library_stop (void)
/* Cleanup the io thing */
brasero_io_shutdown ();
/* close HAL connection */
// brasero_hal_watch_destroy ();
client = gconf_client_get_default ();
gconf_client_remove_dir (client, "/apps/brasero", NULL);
}
gboolean
......
......@@ -934,7 +934,7 @@ nautilus_module_initialize (GTypeModule *module)
DEBUG_PRINT ("Initializing nautilus-disc-recorder\n");
brasero_media_library_start ();
brasero_burn_library_start ();
brasero_burn_library_start (NULL, NULL);
DEBUG_PRINT ("Libbrasero-media started\n");
nautilus_disc_burn_register_type (module);
......
......@@ -69,8 +69,6 @@ gint disc_check;
gint open_ncb;
gint parent_window;
#define BRASERO_CONF_DIR "/apps/brasero"
static const GOptionEntry options [] = {
{ "project", 'p', 0, G_OPTION_ARG_STRING, &project_uri,
N_("Open the specified project"),
......@@ -472,7 +470,6 @@ brasero_app_get_default (void)
int
main (int argc, char **argv)
{
GConfClient *client;
GOptionContext *context;
#ifdef ENABLE_NLS
......@@ -503,18 +500,16 @@ main (int argc, char **argv)
g_option_context_free (context);
gst_init (&argc, &argv);
/* This is for missing codec automatic install */
/* REMINDER: this is done in burn library now */
/* gst_init (&argc, &argv);
gst_pb_utils_init ();
client = gconf_client_get_default ();
gconf_client_add_dir (client,
BRASERO_CONF_DIR,
GCONF_CLIENT_PRELOAD_NONE,
NULL);
brasero_burn_library_start ();
*/
brasero_burn_library_start (&argc, &argv);
brasero_enable_multi_DND ();
......@@ -527,9 +522,6 @@ main (int argc, char **argv)
brasero_burn_library_stop ();
gconf_client_remove_dir (client, BRASERO_CONF_DIR, NULL);
g_object_unref (client);
gst_deinit ();
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment