diff --git a/ChangeLog b/ChangeLog index 7eb13bf64d..ffbcac0305 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2006-07-31 Jan Schmidt + + * gst/gstelementfactory.c: (gst_element_factory_create): + Remove unnecessary ref/unref pair + + * gst/parse/grammar.y: + Make sure to free the parse buffer on all code paths. + Move a g_free up to the error handler where it's easier to see. + + * tests/check/gst/gstevent.c: (test_event): + Extending timeout for downstream travelling events to 10 seconds to + hopefully avoid intermittent failure on the buildbots. + + * tests/check/pipelines/parse-launch.c: (run_delayed_test): + Don't manually set the state of the src element - it will happen as a + natural consequence of the pipeline changing state, and that way it + will do it in the right order too. + 2006-07-31 Wim Taymans * gst/gstutils.c: (gst_pad_get_fixed_caps_func): diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c index 9b9121652d..31d39998a7 100644 --- a/gst/gstelementfactory.c +++ b/gst/gstelementfactory.c @@ -347,15 +347,13 @@ gst_element_factory_create (GstElementFactory * factory, const gchar * name) g_return_val_if_fail (factory != NULL, NULL); - gst_object_ref (factory); - newfactory = GST_ELEMENT_FACTORY (gst_plugin_feature_load (GST_PLUGIN_FEATURE (factory))); + if (newfactory == NULL) goto load_failed; - gst_object_unref (factory); factory = newfactory; if (name) diff --git a/gst/parse/grammar.y b/gst/parse/grammar.y index 654dc7bf90..62ff567a96 100644 --- a/gst/parse/grammar.y +++ b/gst/parse/grammar.y @@ -839,6 +839,9 @@ _gst_parse_launch (const gchar *str, GError **error) SET_ERROR (error, GST_PARSE_ERROR_SYNTAX, "Unrecoverable syntax error while parsing pipeline %s", str); + _gst_parse_yy_delete_buffer (buf); + g_free (dstr); + goto error1; } g_free (dstr); @@ -927,8 +930,6 @@ out: return ret; error1: - g_free (dstr); - if (g.chain) { g_slist_foreach (g.chain->elements, (GFunc)gst_object_unref, NULL); g_slist_free (g.chain->elements); diff --git a/tests/check/gst/gstevent.c b/tests/check/gst/gstevent.c index 0e9313a576..8e06419255 100644 --- a/tests/check/gst/gstevent.c +++ b/tests/check/gst/gstevent.c @@ -299,22 +299,26 @@ static void test_event fail_unless (gst_pad_set_blocked (fake_srcpad, FALSE) == TRUE); - /* Wait up to 5 seconds for the event to appear */ if (expect_before_q) { + /* Wait up to 5 seconds for the event to appear */ for (i = 0; i < 500; i++) { g_usleep (G_USEC_PER_SEC / 100); if (got_event_before_q != NULL) break; } - fail_if (got_event_before_q == NULL); + fail_if (got_event_before_q == NULL, + "Expected event failed to appear upstream of the queue " + "within 5 seconds"); fail_unless (GST_EVENT_TYPE (got_event_before_q) == type); } else { - for (i = 0; i < 500; i++) { + /* Wait up to 10 seconds for the event to appear */ + for (i = 0; i < 1000; i++) { g_usleep (G_USEC_PER_SEC / 100); if (got_event_after_q != NULL) break; } - fail_if (got_event_after_q == NULL); + fail_if (got_event_after_q == NULL, + "Expected event failed to appear after the queue within 10 seconds"); fail_unless (GST_EVENT_TYPE (got_event_after_q) == type); } diff --git a/tests/check/pipelines/parse-launch.c b/tests/check/pipelines/parse-launch.c index b1fedbe502..0cf5a3399d 100644 --- a/tests/check/pipelines/parse-launch.c +++ b/tests/check/pipelines/parse-launch.c @@ -363,10 +363,6 @@ run_delayed_test (const gchar * pipe_str, const gchar * peer, fail_if (gst_element_set_state (pipe, GST_STATE_PAUSED) == GST_STATE_CHANGE_FAILURE); - /* Also set the src state manually to make sure it is changing to that - * state */ - fail_if (gst_element_set_state (src, GST_STATE_PAUSED) == - GST_STATE_CHANGE_FAILURE); fail_if (gst_element_get_state (src, NULL, NULL, GST_CLOCK_TIME_NONE) == GST_STATE_CHANGE_FAILURE);