[gst-devel] problems deleting elements

Ronald Bultje rbultje at ronald.bitfreak.net
Thu May 27 20:11:24 CEST 2004


Hi,

On Thu, 27 May 2004, Mike McLean wrote:
>   /* stop the bin */
>   gst_element_get_state(GST_ELEMENT(thread));
>   cout << "state playing = " << state << endl;

That doesn't look right. You probably want:

state = gst_element_get_state(...

> if I enable the line:
> gst_element_set_state (GST_ELEMENT(element), GST_STATE_NULL);
>
> I get this error after an mp3 finishes playing:
>
> (process:31844): GStreamer-WARNING **: Thread thread is destroying itself.
> Function call will not return!
>
> I know I must be doing something fundamentally dumb but I can't figure out
> what it is.  Any help would be greatly appreciated.

Set an idle handler to delete the element in your main thread. You're now
deleting it in the thread context of the signal-emitting-thread, which is
not a good thing.

Mark (from Amarok) knows how to do this in KDE, it's slightly different
from glib/GNOME since KDE doesn't use GMainLoop's.

Ronald





More information about the gstreamer-devel mailing list