diff -r a05b421242e4 -r 951db7024071 gmyth-stream/gmemcoder/src/gmencoder.c --- a/gmyth-stream/gmemcoder/src/gmencoder.c Wed May 16 18:45:29 2007 +0100 +++ b/gmyth-stream/gmemcoder/src/gmencoder.c Thu May 17 22:44:17 2007 +0100 @@ -162,7 +162,7 @@ g_mencoder_signals[ERROR] = g_signal_new ("error", G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, + G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); @@ -246,11 +246,13 @@ if (prop != NULL) { for (i=0; i < g_strv_length (prop); i++) { - char** v = g_strsplit(prop[i], "=", 2); - if (g_strv_length (v) == 2) { - _obj_set_prop (G_OBJECT (ret), v[0], v[1]); - } - g_strfreev (v); + if (prop[i] != NULL) { + char** v = g_strsplit(prop[i], "=", 2); + if (g_strv_length (v) == 2) { + _obj_set_prop (G_OBJECT (ret), v[0], v[1]); + } + g_strfreev (v); + } } } @@ -635,16 +637,18 @@ } if (priv->pipe != NULL) { - gst_element_set_state (priv->pipe, GST_STATE_NULL); - gst_object_unref (priv->pipe); + GstState state; + GstState pending; + //gst_element_set_state (priv->pipe, GST_STATE_NULL); + //gst_object_unref (priv->pipe); + gst_object_unref (priv->src); + priv->src = NULL; priv->pipe = NULL; priv->abin = NULL; priv->vbin = NULL; priv->sink = NULL; } priv->ready = FALSE; - - } static GstElement* @@ -934,16 +938,23 @@ GError *error; gchar *debug; gchar *err_str; + + if (priv->tick_id != 0) { + g_source_remove (priv->tick_id); + priv->tick_id = 0; + } gst_message_parse_error (msg, &error, &debug); err_str = g_strdup_printf ("Error [%d] %s (%s)", error->code, error->message, debug); + g_debug ("%s", err_str); + priv->ready = FALSE; g_signal_emit (user_data, g_mencoder_signals[ERROR], 0, err_str); - priv->ready = FALSE; g_free (err_str); g_clear_error (&error); g_free (debug); + g_debug ("ERROR DONE"); break; }