[gnac/devel] Fixed a double bug
- From: Benoît Dupasquier <bdupasqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnac/devel] Fixed a double bug
- Date: Sun, 9 May 2010 23:11:36 +0000 (UTC)
commit 5f5fc08a59a0a1b20e170155c21c3811af82117f
Author: Benoît Dupasquier <bdupasqu src gnome org>
Date: Mon May 10 00:10:34 2010 +0100
Fixed a double bug
libgnac/libgnac-media-item.c | 33 +++++++++++++++------------------
1 files changed, 15 insertions(+), 18 deletions(-)
---
diff --git a/libgnac/libgnac-media-item.c b/libgnac/libgnac-media-item.c
index 710de0c..5c5eb91 100644
--- a/libgnac/libgnac-media-item.c
+++ b/libgnac/libgnac-media-item.c
@@ -40,9 +40,9 @@
extern LibgnacMetadata *metadata;
LibgnacMediaItem *
-libgnac_item_new(GFile *source,
- LibgnacProfile *profile,
- gpointer parent)
+libgnac_item_new(GFile *source,
+ LibgnacProfile *profile,
+ gpointer parent)
{
LibgnacMediaItem *item;
@@ -64,7 +64,7 @@ libgnac_item_new(GFile *source,
void
libgnac_item_build(LibgnacMediaItem *item,
- GError **error)
+ GError **error)
{
gboolean has_video = FALSE;
GError *err = NULL;
@@ -75,20 +75,22 @@ libgnac_item_build(LibgnacMediaItem *item,
/* output */
config = libgnac_converter_get_config(item->parent);
- // destination is already there
- if (item->destination) return;
+
+ if (item->destination) {
+ g_object_unref(item->destination);
+ item->destination = NULL;
+ }
item->destination = libgnac_output_build_output(item->source, config, &err);
+
// TODO free config->*
g_free(config);
-
if (err) {
libgnac_warning("Output creation failed");
g_propagate_error(error, err);
return;
}
-
/* is it a video file? */
// TODO why not passing error ?
tags = libgnac_metadata_extract(metadata, item->source, NULL);
@@ -101,7 +103,6 @@ libgnac_item_build(LibgnacMediaItem *item,
libgnac_warning("Unable to build pipeline");
libgnac_gst_clean_pipeline(item);
g_propagate_error(error, err);
-
return;
}
@@ -111,21 +112,18 @@ libgnac_item_build(LibgnacMediaItem *item,
g_signal_connect(G_OBJECT(item->bus), "message::error",
G_CALLBACK(libgnac_item_error_cb), item);
-
/* Connect parent callbacks */
// TODO move
g_signal_connect(G_OBJECT(item->bus), "message::eos",
G_CALLBACK(libgnac_converter_eos_cb), item->parent);
g_signal_connect(G_OBJECT(item->bus), "message::error",
G_CALLBACK(libgnac_converter_error_cb), item->parent);
-
-
}
void
libgnac_item_run(LibgnacMediaItem *item,
- GError **error)
+ GError **error)
{
GError *err = NULL;
g_return_if_fail(error == NULL || *error == NULL);
@@ -140,7 +138,6 @@ libgnac_item_run(LibgnacMediaItem *item,
}
}
-
libgnac_item_init_event_src(item);
libgnac_gst_run(item, &err);
@@ -155,7 +152,7 @@ libgnac_item_run(LibgnacMediaItem *item,
void
libgnac_item_stop(LibgnacMediaItem *item,
- GError **error)
+ GError **error)
{
GError *err = NULL;
g_return_if_fail(error == NULL || *error == NULL);
@@ -180,7 +177,7 @@ libgnac_item_stop(LibgnacMediaItem *item,
/*void
libgnac_item_pause(LibgnacMediaItem *item,
- GError **error)
+ GError **error)
{
g_return_if_fail(error == NULL || *error == NULL);
}
@@ -188,7 +185,7 @@ libgnac_item_pause(LibgnacMediaItem *item,
void
libgnac_item_resume(LibgnacMediaItem *item,
- GError **error)
+ GError **error)
{
g_return_if_fail(error == NULL || *error == NULL);
}*/
@@ -249,7 +246,7 @@ libgnac_item_eos_cb(GstBus *bus,
void
-libgnac_item_error_cb(GstBus *bus,
+libgnac_item_error_cb(GstBus *bus,
GstMessage *message,
gpointer data)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]