diff options
-rw-r--r-- | tests/check/elements/adaptive_demux_common.c | 2 | ||||
-rw-r--r-- | tests/check/elements/adaptive_demux_engine.c | 1 | ||||
-rw-r--r-- | tests/check/elements/audiomixer.c | 1 | ||||
-rw-r--r-- | tests/check/elements/autovideoconvert.c | 4 | ||||
-rw-r--r-- | tests/check/elements/camerabin.c | 23 |
5 files changed, 16 insertions, 15 deletions
diff --git a/tests/check/elements/adaptive_demux_common.c b/tests/check/elements/adaptive_demux_common.c index a8fcb1e7c..814b0eadc 100644 --- a/tests/check/elements/adaptive_demux_common.c +++ b/tests/check/elements/adaptive_demux_common.c @@ -431,6 +431,7 @@ testSeekOnStateChanged (GstBus * bus, GstMessage * msg, gpointer user_data) TEST_TASK_STATE_WAITING_FOR_TESTSRC_STATE_CHANGE) { GST_DEBUG ("changing test_task_state"); testData->test_task_state = TEST_TASK_STATE_EXITING; + gst_bus_remove_signal_watch (bus); g_cond_signal (&testData->test_task_state_cond); } g_mutex_unlock (&testData->test_task_state_lock); @@ -454,6 +455,7 @@ testSeekPreTestCallback (GstAdaptiveDemuxTestEngine * engine, gst_bus_add_signal_watch (bus); g_signal_connect (bus, "message::state-changed", G_CALLBACK (testSeekOnStateChanged), testData); + gst_object_unref (bus); } static void diff --git a/tests/check/elements/adaptive_demux_engine.c b/tests/check/elements/adaptive_demux_engine.c index 4662a004f..b96983154 100644 --- a/tests/check/elements/adaptive_demux_engine.c +++ b/tests/check/elements/adaptive_demux_engine.c @@ -595,6 +595,7 @@ gst_adaptive_demux_test_run (const gchar * element_name, priv->engine.pipeline = NULL; g_main_loop_unref (priv->engine.loop); g_ptr_array_unref (priv->engine.output_streams); + gst_object_unref (bus); GST_TEST_UNLOCK (priv); g_mutex_clear (&priv->engine.lock); diff --git a/tests/check/elements/audiomixer.c b/tests/check/elements/audiomixer.c index 00be1c6ee..9ef5c3c8f 100644 --- a/tests/check/elements/audiomixer.c +++ b/tests/check/elements/audiomixer.c @@ -723,6 +723,7 @@ GST_START_TEST (test_live_seeking) g_main_loop_unref (main_loop); if (play_seek_event) gst_event_unref (play_seek_event); + gst_bus_remove_signal_watch (bus); gst_object_unref (bus); gst_object_unref (bin); } diff --git a/tests/check/elements/autovideoconvert.c b/tests/check/elements/autovideoconvert.c index 268f0944a..56757ab00 100644 --- a/tests/check/elements/autovideoconvert.c +++ b/tests/check/elements/autovideoconvert.c @@ -77,8 +77,6 @@ run_test (const gchar * pipeline_string) g_signal_connect (bus, "message", (GCallback) on_message_cb, &omud); - gst_object_unref (bus); - ret = gst_element_set_state (pipeline, GST_STATE_PLAYING); fail_unless (ret == GST_STATE_CHANGE_SUCCESS || ret == GST_STATE_CHANGE_ASYNC); @@ -90,6 +88,8 @@ run_test (const gchar * pipeline_string) fail_unless (omud.eos == TRUE); + gst_bus_remove_signal_watch (bus); + gst_object_unref (bus); gst_object_unref (pipeline); g_main_loop_unref (loop); diff --git a/tests/check/elements/camerabin.c b/tests/check/elements/camerabin.c index f6d7c7cdf..e554b0b73 100644 --- a/tests/check/elements/camerabin.c +++ b/tests/check/elements/camerabin.c @@ -439,7 +439,7 @@ gst_test_video_src_init (GstTestVideoSrc * self) static GstElement *camera; static GstElement *testsrc; -static guint bus_source; +static GstBus *bus = NULL; static GMainLoop *main_loop; static gint capture_count = 0; guint32 test_id = 0; @@ -615,21 +615,20 @@ extract_jpeg_tags (const gchar * filename, gint num) gchar *pipeline_str = g_strdup_printf ("filesrc location=%s ! " "jpegparse ! fakesink", filepath); GstElement *pipeline; - guint source; pipeline = gst_parse_launch (pipeline_str, NULL); fail_unless (pipeline != NULL); g_free (pipeline_str); bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); - source = gst_bus_add_watch (bus, (GstBusFunc) validity_bus_cb, loop); + gst_bus_add_watch (bus, (GstBusFunc) validity_bus_cb, loop); gst_element_set_state (pipeline, GST_STATE_PLAYING); g_main_loop_run (loop); gst_element_set_state (pipeline, GST_STATE_NULL); + gst_bus_remove_watch (bus); gst_object_unref (bus); - g_source_remove (source); gst_object_unref (pipeline); g_main_loop_unref (loop); } @@ -637,9 +636,7 @@ extract_jpeg_tags (const gchar * filename, gint num) static void setup_camerabin_common (void) { - GstBus *bus; test_id = g_random_int (); - bus_source = 0; main_loop = g_main_loop_new (NULL, TRUE); @@ -647,8 +644,7 @@ setup_camerabin_common (void) fail_unless (camera != NULL, "failed to create camerabin element"); bus = gst_pipeline_get_bus (GST_PIPELINE (camera)); - bus_source = gst_bus_add_watch (bus, (GstBusFunc) capture_bus_cb, main_loop); - gst_object_unref (bus); + gst_bus_add_watch (bus, (GstBusFunc) capture_bus_cb, main_loop); tags_found = NULL; capture_count = 0; @@ -748,8 +744,10 @@ teardown (void) gst_check_teardown_element (camera); camera = NULL; - if (bus_source) - g_source_remove (bus_source); + if (bus) { + gst_bus_remove_watch (bus); + gst_object_unref (bus); + } if (main_loop) g_main_loop_unref (main_loop); @@ -842,7 +840,6 @@ check_file_validity (const gchar * filename, gint num, GstTagList * taglist, GstCaps *caps; gint caps_width, caps_height; GstState state; - guint source; GMainLoop *loop = g_main_loop_new (NULL, FALSE); GstElement *playbin = gst_element_factory_make ("playbin", NULL); @@ -856,7 +853,7 @@ check_file_validity (const gchar * filename, gint num, GstTagList * taglist, "audio-sink", fakeaudio, NULL); bus = gst_pipeline_get_bus (GST_PIPELINE (playbin)); - source = gst_bus_add_watch (bus, (GstBusFunc) validity_bus_cb, loop); + gst_bus_add_watch (bus, (GstBusFunc) validity_bus_cb, loop); gst_element_set_state (playbin, GST_STATE_PAUSED); gst_element_get_state (playbin, &state, NULL, GST_SECOND * 3); @@ -899,7 +896,7 @@ check_file_validity (const gchar * filename, gint num, GstTagList * taglist, } g_free (uri); - g_source_remove (source); + gst_bus_remove_watch (bus); gst_object_unref (bus); gst_object_unref (playbin); g_main_loop_unref (loop); |