[gstreamer-bugs] [Bug 512382] New: race condition when pausing/playing multiple elements
GStreamer (bugzilla.gnome.org)
bugzilla-daemon at bugzilla.gnome.org
Sun Jan 27 07:03:49 PST 2008
If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
http://bugzilla.gnome.org/show_bug.cgi?id=512382
GStreamer | don't know | Ver: 0.10.16
Summary: race condition when pausing/playing multiple elements
Product: GStreamer
Version: 0.10.16
Platform: Other
OS/Version: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: don't know
AssignedTo: gstreamer-bugs at lists.sourceforge.net
ReportedBy: marcus.brinkmann at ruhr-uni-bochum.de
QAContact: gstreamer-bugs at lists.sourceforge.net
GNOME version: 2.19/2.20
GNOME milestone: Unspecified
Please describe the problem:
When I create multiple playbin elements in the paused or ready state quickly
after each other, things get pretty messed up. Most of the time, only one of
the files actually can be heard (the other seems to "play" silently), but once
in a while I get random assertion failues, crashes, etc.
If there is a one second pause between the individual element's creation and
setup, all files can be heard playing.
Steps to reproduce:
Run the following example program, for example with two file:///file1.ogg and
file:///file2.ogg.
#include <gst/gst.h>
GMainLoop *loop;
static gboolean
my_bus_callback (GstBus *bus, GstMessage *message, gpointer data)
{
switch (GST_MESSAGE_TYPE (message))
{
case GST_MESSAGE_ERROR:
{
GError *err;
gchar *debug;
gst_message_parse_error (message, &err, &debug);
g_print ("Error: %s\n", err->message);
g_error_free (err);
g_free (debug);
g_main_quit (loop);
break;
}
case GST_MESSAGE_EOS:
/* end-of-stream */
g_main_quit (loop);
break;
default:
/* unhandled message */
break;
}
/* We want to be notified again the next time there is a message on
the bus, so returning TRUE (FALSE means we want to stop watching
for messages on the bus and our callback should not be called
again). */
return TRUE;
}
int
main (int argc, char *argv[])
{
gst_init (&argc, &argv);
loop = g_main_loop_new (NULL, FALSE);
argc--;
argv++;
while (argc-- > 0)
{
GstElement *play;
GstBus *bus;
play = gst_element_factory_make ("playbin", "play");
g_object_set (G_OBJECT (play), "uri", argv[0], NULL);
argv++;
bus = gst_pipeline_get_bus (GST_PIPELINE (play));
gst_bus_add_watch (bus, my_bus_callback, loop);
gst_object_unref (bus);
gst_element_set_state (play, GST_STATE_PLAYING);
// Sleep works around it.
// sleep (1);
}
g_main_loop_run (loop);
return 0;
}
Actual results:
Most of the time, only one file is heard from the speaker. Sometimes, various
random crashes and assertion failures occur, for example:
* main3: pcm.c:725: snd_pcm_nonblock: Assertion `pcm' failed.
* (main3:16472): GLib-GObject-WARNING **: invalid (NULL) pointer instance
(main3:16472): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion
`G_TYPE_CHECK_INSTANCE (instance)' failed
(main3:16472): GLib-GObject-CRITICAL **: g_object_set_data: assertion
`G_IS_OBJECT (object)' failed
(main3:16472): GStreamer-CRITICAL **: gst_pad_link_prepare: assertion
`GST_IS_PAD (sinkpad)' failed
(main3:16472): GStreamer-CRITICAL **: gst_object_unref: assertion `object !=
NULL' failed
Error: Internal data stream error.
* (main3:17385): GLib-GObject-WARNING **: IA__g_object_set_valist: object class
`GstStreamInfo' has no property named `mute'
Expected results:
What should happen is that both files start playing and are heard.
Does this happen every time?
Yes.
Other information:
sleep(1) after changing the state to PLAYING works around it.
--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.
You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=512382.
More information about the Gstreamer-bugs
mailing list