After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 142501 - [esdsink] lock with threaded gstreamer
[esdsink] lock with threaded gstreamer
Status: RESOLVED DUPLICATE of bug 136572
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-05-13 21:17 UTC by Nickolay V. Shmyrev
Modified: 2005-01-29 12:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Nickolay V. Shmyrev 2004-05-13 21:17:26 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);
}
Comment 1 Thomas Vander Stichele 2004-07-06 13:25:29 UTC
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.
Comment 2 Nickolay V. Shmyrev 2004-07-07 10:22:16 UTC
But why it affects other applications?
Comment 3 Ronald Bultje 2005-01-29 12:09:12 UTC
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 ***