[gst-devel] threads, eos
in7y118 at public.uni-hamburg.de
in7y118 at public.uni-hamburg.de
Fri Feb 13 08:07:30 CET 2004
Quoting Gert van Valkenhoef <gertvv at hccnet.nl>:
> Hi,
>
> I'm trying to build a threaded audio player application using
> gstreamer. I have a problem with the GstThread element, it insists on
> destroying itself, causing playback to stop.
>
> I have a thread setup with the following elements in it:
> filesrc ! spider ! osssink
> And I have the following callback registered:
> g_signal_connect (G_OBJECT(player->thread), "eos",
> G_CALLBACK(eos_cb), player);
>
> The callback gets called, but when I do anything with the pipeline (for
> example, changing state to GST_STATE_NULL, then set the filename for
> the source element, change back to GST_STATE_PLAYING) I get the
> following error:
>
> (gmms:13331): GStreamer-WARNING **: Thread playback_thread is
> destroying itself. Function call will not return!
>
> When I do a GST_STATE_NULL, change filename, GST_STATE_PLAYING from the
> GUI thread, everything works fine.
>
> Is a thread always destroyed on EOS? If so, how can I bypass this or
> send a message to my GUI thread so I can continue playback to the next
> song?
>
A GstThread destroys its thread when you set it to NULL and that causes this
warning. Merely geting EOS doesn't destroy it.
The suggested behaviour is what you do - connect an idle handler from the main
thread and then change the state of the thread.
Benjamin
More information about the gstreamer-devel
mailing list