GstBus *bus;
GMainLoop *loop;
guint i;
+ guint bus_watch = 0;
audiotestsrc = g_new0 (GstElement *, channels);
bus = gst_element_get_bus (pipeline);
fail_unless (bus != NULL);
- gst_bus_add_watch (bus, bus_handler, loop);
+ bus_watch = gst_bus_add_watch (bus, bus_handler, loop);
gst_object_unref (bus);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
gst_object_unref (pipeline);
g_free (audiotestsrc);
+
+ g_main_loop_unref (loop);
+ g_source_remove (bus_watch);
}
GST_START_TEST (test_encode_stereo)