GNOME Bugzilla – Bug 142501
[esdsink] lock with threaded gstreamer
Last modified: 2005-01-29 12:09:12 UTC
How to reproduce: 1. Start any esd based application (xmms or xine) 2. Start the test ./test somefile.wav 3. After end of somefile playing, the other esd applications will lock until the test exit or interrupt. Why I think, that something strange with gstreamer - because I can't reproduce problem with non-threaded gst play, for example, gst-launch. test.c: #include <stdlib.h> #include <gst/gst.h> int main (int argc, char *argv[]) { GstElement *filesrc, *sink, *spider; GstElement *thread; gst_init (&argc, &argv); if (argc != 2) { g_print ("usage: %s <filename>\n", argv[0]); exit (-1); } /* create a new thread to hold the elements */ thread = gst_thread_new ("thread"); g_assert (thread != NULL); /* create a disk reader */ filesrc = gst_element_factory_make ("filesrc", "disk_source"); g_assert (filesrc != NULL); g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL); sink = gst_element_factory_make ("esdsink", "play_audio"); g_assert (sink != NULL); spider = gst_element_factory_make ("spider", "spider"); g_assert (spider != NULL); gst_bin_add_many(GST_BIN(thread),filesrc, spider, sink, NULL); gst_element_link_many(filesrc, spider, sink, NULL); /* make it ready */ gst_element_set_state (GST_ELEMENT (thread), GST_STATE_READY); /* start playing */ gst_element_set_state (GST_ELEMENT (thread), GST_STATE_PLAYING); gst_main (); gst_object_unref (GST_OBJECT (thread)); exit (0); }
I don't think it's a bug - basically, you're not connecting a signal handler to for example eos, which would allow you to change the state to NULL after playback. So gst_main () never quits since the thread stays in playing, and goes to PAUSED after eos. But you're not disposing of the objects.
But why it affects other applications?
Because esd used to pause its own connection (which pauses the server), but that was fixed ages ago. *** This bug has been marked as a duplicate of 136572 ***