2 * Copyright (C) 2004 Benjamin Otte <otte@gnome.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public
15 * License along with this library; if not, write to the Free
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 * This file reproduces the bug in the bugreport #143777, as can be seen at
21 * http://bugzilla.gnome.org/show_bug.cgi?id=143777 - the issue is that when
22 * pausing a pipeline while the chainhandler is still running, then unlinking
23 * the pad that's chain function is called and relinking it clears the buffer
24 * that was stored for sending the event. gst_pad_call_chain_function needs
26 * The fix is in gstpad.c, revision 1.327
32 main (gint argc, gchar ** argv)
34 GstElement *pipeline, *src, *sink, *id;
37 gst_init (&argc, &argv);
39 g_print ("setting up...\n");
41 pipeline = gst_element_factory_make ("pipeline", NULL);
43 src = gst_element_factory_make ("fakesrc", NULL);
45 id = gst_element_factory_make ("identity", NULL);
47 sink = gst_element_factory_make ("fakesink", NULL);
50 gst_bin_add_many (GST_BIN (pipeline), src, id, sink, NULL);
52 g_print ("running... (%d iterations)\n", i);
53 if (gst_element_set_state (pipeline,
54 GST_STATE_PLAYING) != GST_STATE_SUCCESS)
55 g_assert_not_reached ();
56 gst_element_link_many (src, id, sink, NULL);
57 for (j = 0; j < i; j++)
58 gst_bin_iterate (GST_BIN (pipeline));
59 if (gst_element_set_state (pipeline, GST_STATE_PAUSED) != GST_STATE_SUCCESS)
60 g_assert_not_reached ();
61 gst_element_unlink_many (src, id, sink, NULL);
65 g_print ("cleaning up...\n");
67 gst_object_unref (pipeline);
68 src = id = sink = pipeline = NULL;