mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 20:59:44 +00:00
gst/gstelementfactory.c: Remove unnecessary ref/unref pair
Original commit message from CVS: * 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.
This commit is contained in:
parent
ee177d64c5
commit
bc3daae9c2
5 changed files with 30 additions and 13 deletions
18
ChangeLog
18
ChangeLog
|
@ -1,3 +1,21 @@
|
||||||
|
2006-07-31 Jan Schmidt <thaytan@mad.scientist.com>
|
||||||
|
|
||||||
|
* 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 <wim@fluendo.com>
|
2006-07-31 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* gst/gstutils.c: (gst_pad_get_fixed_caps_func):
|
* gst/gstutils.c: (gst_pad_get_fixed_caps_func):
|
||||||
|
|
|
@ -347,15 +347,13 @@ gst_element_factory_create (GstElementFactory * factory, const gchar * name)
|
||||||
|
|
||||||
g_return_val_if_fail (factory != NULL, NULL);
|
g_return_val_if_fail (factory != NULL, NULL);
|
||||||
|
|
||||||
gst_object_ref (factory);
|
|
||||||
|
|
||||||
newfactory =
|
newfactory =
|
||||||
GST_ELEMENT_FACTORY (gst_plugin_feature_load (GST_PLUGIN_FEATURE
|
GST_ELEMENT_FACTORY (gst_plugin_feature_load (GST_PLUGIN_FEATURE
|
||||||
(factory)));
|
(factory)));
|
||||||
|
|
||||||
if (newfactory == NULL)
|
if (newfactory == NULL)
|
||||||
goto load_failed;
|
goto load_failed;
|
||||||
|
|
||||||
gst_object_unref (factory);
|
|
||||||
factory = newfactory;
|
factory = newfactory;
|
||||||
|
|
||||||
if (name)
|
if (name)
|
||||||
|
|
|
@ -839,6 +839,9 @@ _gst_parse_launch (const gchar *str, GError **error)
|
||||||
SET_ERROR (error, GST_PARSE_ERROR_SYNTAX,
|
SET_ERROR (error, GST_PARSE_ERROR_SYNTAX,
|
||||||
"Unrecoverable syntax error while parsing pipeline %s", str);
|
"Unrecoverable syntax error while parsing pipeline %s", str);
|
||||||
|
|
||||||
|
_gst_parse_yy_delete_buffer (buf);
|
||||||
|
g_free (dstr);
|
||||||
|
|
||||||
goto error1;
|
goto error1;
|
||||||
}
|
}
|
||||||
g_free (dstr);
|
g_free (dstr);
|
||||||
|
@ -927,8 +930,6 @@ out:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
error1:
|
error1:
|
||||||
g_free (dstr);
|
|
||||||
|
|
||||||
if (g.chain) {
|
if (g.chain) {
|
||||||
g_slist_foreach (g.chain->elements, (GFunc)gst_object_unref, NULL);
|
g_slist_foreach (g.chain->elements, (GFunc)gst_object_unref, NULL);
|
||||||
g_slist_free (g.chain->elements);
|
g_slist_free (g.chain->elements);
|
||||||
|
|
|
@ -299,22 +299,26 @@ static void test_event
|
||||||
|
|
||||||
fail_unless (gst_pad_set_blocked (fake_srcpad, FALSE) == TRUE);
|
fail_unless (gst_pad_set_blocked (fake_srcpad, FALSE) == TRUE);
|
||||||
|
|
||||||
/* Wait up to 5 seconds for the event to appear */
|
|
||||||
if (expect_before_q) {
|
if (expect_before_q) {
|
||||||
|
/* Wait up to 5 seconds for the event to appear */
|
||||||
for (i = 0; i < 500; i++) {
|
for (i = 0; i < 500; i++) {
|
||||||
g_usleep (G_USEC_PER_SEC / 100);
|
g_usleep (G_USEC_PER_SEC / 100);
|
||||||
if (got_event_before_q != NULL)
|
if (got_event_before_q != NULL)
|
||||||
break;
|
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);
|
fail_unless (GST_EVENT_TYPE (got_event_before_q) == type);
|
||||||
} else {
|
} 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);
|
g_usleep (G_USEC_PER_SEC / 100);
|
||||||
if (got_event_after_q != NULL)
|
if (got_event_after_q != NULL)
|
||||||
break;
|
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);
|
fail_unless (GST_EVENT_TYPE (got_event_after_q) == type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -363,10 +363,6 @@ run_delayed_test (const gchar * pipe_str, const gchar * peer,
|
||||||
fail_if (gst_element_set_state (pipe, GST_STATE_PAUSED) ==
|
fail_if (gst_element_set_state (pipe, GST_STATE_PAUSED) ==
|
||||||
GST_STATE_CHANGE_FAILURE);
|
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) ==
|
fail_if (gst_element_get_state (src, NULL, NULL, GST_CLOCK_TIME_NONE) ==
|
||||||
GST_STATE_CHANGE_FAILURE);
|
GST_STATE_CHANGE_FAILURE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue