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) {
14 ("Could not run test, because element type \"%s\" is not installed. Please retry when it is. Assuming it works for now...",
23 create_pipeline (void)
29 pipeline = gst_pipeline_new ("pipeline");
30 src = make_and_check_element ("sinesrc", "src");
32 * You need a sink with a loop-based element in here, if you want to kill opt, too.
33 * Osssink (chain-based) only breaks the basic scheduler.
35 sink = make_and_check_element ("alsasink", "sink");
38 gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);
39 gst_element_link (src, sink);
42 * now make the bug appear
43 * I believe it has something to do with 2 chains being created in the scheduler
44 * but I haven't looked at it yet
45 * If you comment out the next 4 lines, everything works fine.
46 * And no, it's not because of identity, you may use any other element.
48 gst_element_unlink (src, sink);
49 id = make_and_check_element ("identity", "id");
50 gst_bin_add (GST_BIN (pipeline), id);
51 gst_element_link_many (src, id, sink, NULL);
53 /* This pipeline will not be removed properly once we unref it */
54 gst_element_set_state (pipeline, GST_STATE_PLAYING);
58 main (gint argc, gchar * argv[])
60 gst_init (&argc, &argv);
65 * only inc i when it works, so the program hangs when _iterate returns false,
66 * which it does after the first pipeline isn't unref'd properly and the next
67 * osssink refuses to work.
69 if (gst_bin_iterate (GST_BIN (pipeline)))
72 gst_object_unref (pipeline);