[Gstreamer-bugs] [Bug 142514] New: - tee element segfaults when sink linked after source(s)
bugzilla-daemon at bugzilla.gnome.org
bugzilla-daemon at bugzilla.gnome.org
Thu May 13 21:23:03 PDT 2004
http://bugzilla.gnome.org/show_bug.cgi?id=142514
GStreamer | gstreamer (core) | Ver: 0.8.1
Summary: tee element segfaults when sink linked after source(s)
Product: GStreamer
Version: 0.8.1
Platform: Other
OS/Version: Linux
Status: UNCONFIRMED
Severity: major
Priority: Normal
Component: gstreamer (core)
AssignedTo: gstreamer-maint at bugzilla.gnome.org
ReportedBy: protectr at hotpop.com
QAContact: gstreamer-maint at bugzilla.gnome.org
When using a tee element, linking an element to its sink pad AFTER a source has
already been linked to it makes it segfault when setting the pipeline to state
PLAYING.
When the sink pad is linked to an element BEFORE the source has been linked, the
tee works as expected.
Example of a tee that works (sink pad linked BEFORE the source):
tee_works.c:
#include <gst/gst.h>
int main (int argc, char *argv[])
{
GstElement *pipeline, *sine, *tee, *audiosink;
GstPad *src, *sink;
gst_init (&argc, &argv);
pipeline = gst_pipeline_new ("main");
sine = gst_element_factory_make ("sinesrc", "source");
tee = gst_element_factory_make ("tee", "splitter");
audiosink = gst_element_factory_make ("alsasink", "ouput");
gst_bin_add_many (GST_BIN(pipeline), sine, tee, audiosink, NULL);
/* Linking the elements */
/* Linking the sink of the tee BEFORE requesting and linking a source pad */
gst_element_link_many (sine, tee, NULL);
sink = gst_element_get_pad (audiosink, "sink");
src = gst_element_get_request_pad (tee, "src%d");
gst_pad_link (src, sink);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
while (gst_bin_iterate (GST_BIN (pipeline)));
gst_element_set_state (pipeline, GST_STATE_NULL);
gst_object_unref (GST_OBJECT (pipeline));
return 0;
}
Example of a tee that causes a segmentation fault (sink pad linked AFTER a
source pad has been linked):
tee_segfaults.c:
#include <gst/gst.h>
int main (int argc, char *argv[])
{
GstElement *pipeline, *sine, *tee, *audiosink;
GstPad *src, *sink;
gst_init (&argc, &argv);
pipeline = gst_pipeline_new ("main");
sine = gst_element_factory_make ("sinesrc", "source");
tee = gst_element_factory_make ("tee", "splitter");
audiosink = gst_element_factory_make ("alsasink", "ouput");
gst_bin_add_many (GST_BIN(pipeline), sine, tee, audiosink, NULL);
/* Linking the elements */
sink = gst_element_get_pad (audiosink, "sink");
src = gst_element_get_request_pad (tee, "src%d");
gst_pad_link (src, sink);
/* Linking the sink of the tee AFTER a source pad has been requested and linked */
gst_element_link_many (sine, tee, NULL);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
while (gst_bin_iterate (GST_BIN (pipeline)));
gst_element_set_state (pipeline, GST_STATE_NULL);
gst_object_unref (GST_OBJECT (pipeline));
return 0;
}
The sample code above has been attached to the bug.
The code was compiled using gstreamer 0.8.1, compiled with gcc 3.3.3
Command line used to compile:
gcc -o works -Wall -g `pkg-config --cflags --libs gstreamer-0.8` tee_works.c
gcc -o works -Wall -g `pkg-config --cflags --libs gstreamer-0.8` tee_segfaults.c
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
You are the QA contact for the bug, or are watching the QA contact.
More information about the Gstreamer-bugs
mailing list