5 GstPadChainFunction oss_chain;
8 make_and_check_element (gchar *type, gchar *name)
10 GstElement *element = gst_element_factory_make (type, name);
12 if (element == NULL) {
13 g_warning ("Could not run test, because element type \"%s\" is not installed. Please retry when it is. Assuming it works for now...", type);
21 create_pipeline (void)
27 pipeline = gst_pipeline_new ("pipeline");
28 src = make_and_check_element ("sinesrc", "src");
30 * You need a sink with a loop-based element in here, if you want to kill opt, too.
31 * Osssink (chain-based) only breaks the basic scheduler.
33 sink = make_and_check_element ("alsasink", "sink");
36 gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);
37 gst_element_link (src, sink);
40 * now make the bug appear
41 * I believe it has something to do with 2 chains being created in the scheduler
42 * but I haven't looked at it yet
43 * If you comment out the next 4 lines, everything works fine.
44 * And no, it's not because of identity, you may use any other element.
46 gst_element_unlink (src, sink);
47 id = make_and_check_element ("identity", "id");
48 gst_bin_add (GST_BIN (pipeline), id);
49 gst_element_link_many (src, id, sink, NULL);
51 /* This pipeline will not be removed properly once we unref it */
52 gst_element_set_state (pipeline, GST_STATE_PLAYING);
56 main (gint argc, gchar *argv[])
58 gst_init (&argc, &argv);
63 * only inc i when it works, so the program hangs when _iterate returns false,
64 * which it does after the first pipeline isn't unref'd properly and the next
65 * osssink refuses to work.
67 if (gst_bin_iterate (GST_BIN (pipeline)))
70 gst_object_unref (GST_OBJECT (pipeline));