marlin r1358 - in trunk: marlin src
- From: iain svn gnome org
- To: svn-commits-list gnome org
- Subject: marlin r1358 - in trunk: marlin src
- Date: Tue, 17 Feb 2009 21:22:13 +0000 (UTC)
Author: iain
Date: Tue Feb 17 21:22:13 2009
New Revision: 1358
URL: http://svn.gnome.org/viewvc/marlin?rev=1358&view=rev
Log:
Squashed commit of the following:
commit 8929e8e2e313f2e66995430e93c3d43cbce82133
Author: Iain Holmes <iain openedhand com mailto:iain openedhand com>
Date: Tue Feb 17 21:20:46 2009 +0000
Remove debugging spew
Remove the unknown type callback when loading, allow unknown types to be handled
in the normal manner. Stops a crash when loading an unknown type.
Disconnect from the bus callback signals whenever destroying a load pipeline.
Modified:
trunk/marlin/marlin-load-pipeline.c
trunk/src/marlin-window.c
Modified: trunk/marlin/marlin-load-pipeline.c
==============================================================================
--- trunk/marlin/marlin-load-pipeline.c (original)
+++ trunk/marlin/marlin-load-pipeline.c Tue Feb 17 21:22:13 2009
@@ -53,6 +53,8 @@
GPtrArray *sinks; /* Array of MarlinChannelSink */
GstPad *audio_pad;
+
+ guint32 bus_id;
};
#define GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), MARLIN_LOAD_PIPELINE_TYPE, MarlinLoadPipelinePrivate))
@@ -101,6 +103,13 @@
priv->sample = NULL;
}
+ if (priv->bus_id > 0) {
+ GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
+ g_signal_handler_disconnect (bus, priv->bus_id);
+ g_object_unref (bus);
+ priv->bus_id = 0;
+ }
+
G_OBJECT_CLASS (marlin_load_pipeline_parent_class)->dispose (object);
}
@@ -246,38 +255,6 @@
}
static void
-unknown_type_cb (GstElement *decodebin,
- GstPad *pad,
- GstCaps *caps,
- MarlinLoadPipeline *pipeline)
-{
- MarlinLoadPipelinePrivate *priv;
- MarlinOperation *operation;
- GError *error;
- char *type, *debug;
-
- priv = pipeline->priv;
-
- g_object_get (G_OBJECT (pipeline),
- "operation", &operation,
- NULL);
-
- type = gst_caps_to_string (caps);
- error = g_error_new (MARLIN_LOAD_PIPELINE_ERROR,
- MARLIN_LOAD_PIPELINE_ERROR_UNKNOWN_TYPE,
- _("Unable to load %s\nCannot find a decoder for %s"),
- priv->filename, type);
-
- debug = g_strconcat ("Unknown type: ", type, NULL);
- g_free (type);
-
- marlin_operation_set_error (operation, error, debug);
-
- g_free (debug);
- g_error_free (error);
-}
-
-static void
new_splitter_pad (GstElement *splitter,
GstPad *pad,
MarlinLoadPipeline *pipeline)
@@ -352,7 +329,7 @@
priv->audio_pad = pad;
/* Lets connect it */
- priv->audioconvert = gst_element_factory_make ("audioconvert",
+ priv->audioconvert = gst_element_factory_make ("audioconvert",
"audioconvert");
priv->splitter = gst_element_factory_make ("marlin-channel-splitter",
"splitter");
@@ -362,18 +339,18 @@
gst_bin_add_many (GST_BIN (pipeline), priv->audioconvert,
priv->splitter, NULL);
- convert_sink = gst_element_get_pad (priv->audioconvert,
+ convert_sink = gst_element_get_pad (priv->audioconvert,
"sink");
- if (gst_pad_link (priv->audio_pad,
+ if (gst_pad_link (priv->audio_pad,
convert_sink) != GST_PAD_LINK_OK) {
g_print ("Failed to link audio_pad to converter\n");
return;
}
- filtercaps = gst_caps_new_simple ("audio/x-raw-float",
+ filtercaps = gst_caps_new_simple ("audio/x-raw-float",
NULL);
if (gst_element_link_filtered (priv->audioconvert,
- priv->splitter,
+ priv->splitter,
filtercaps) == FALSE) {
g_print ("Failed to link audioconvert and splitter\n");
gst_caps_unref (filtercaps);
@@ -508,8 +485,6 @@
g_warning ("No source available for load pipeline.");
}
priv->decoder = gst_element_factory_make ("decodebin", "decoder");
- g_signal_connect (G_OBJECT (priv->decoder), "unknown-type",
- G_CALLBACK (unknown_type_cb), pipeline);
g_signal_connect (G_OBJECT (priv->decoder), "new-decoded-pad",
G_CALLBACK (new_decoder_pad), pipeline);
@@ -523,8 +498,9 @@
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
gst_bus_add_signal_watch (bus);
- g_signal_connect (bus, "message",
- G_CALLBACK (bus_message_cb), pipeline);
+ priv->bus_id = g_signal_connect (bus, "message",
+ G_CALLBACK (bus_message_cb), pipeline);
+ g_object_unref (bus);
}
MarlinLoadPipeline *
Modified: trunk/src/marlin-window.c
==============================================================================
--- trunk/src/marlin-window.c (original)
+++ trunk/src/marlin-window.c Tue Feb 17 21:22:13 2009
@@ -1478,12 +1478,10 @@
/* If we don't own jack, we don't want to know about any of
its events. We'll just get confused */
if (own_jack) {
- g_print ("Unblocking signals\n");
g_signal_handler_unblock (priv->jack, priv->eos_id);
g_signal_handler_unblock (priv->jack, priv->level_id);
g_signal_handler_unblock (priv->jack, priv->position_id);
} else {
- g_print ("Blocking signals\n");
g_signal_handler_block (priv->jack, priv->eos_id);
g_signal_handler_block (priv->jack, priv->level_id);
g_signal_handler_block (priv->jack, priv->position_id);
@@ -3085,7 +3083,6 @@
window->priv->progress_window = NULL;
pipeline = sod->pipeline;
- g_print ("Save-Op finished\n");
/* Reset the time of last save */
window->priv->last_save = time (NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]