[gst-devel] seg fault: on gst_element_set_state(pipeline, GST_STATE_READY)

Yann Gilquin yann.gilquin at purplelabs.com
Wed Jul 18 14:18:23 CEST 2007


pritesh wrote:

[snip]

> void on_stopkey()
> {
> g_main_loop_quit(loop);
> gst_element_set_state(pipeline,GST_STATE_READY); // CREATES A
> SEGMENTATION FAULT HERE
> gst_object_unref(GST_OBJECT(pipeline);
> }
>
1st of all : your code can't compile... that's one point. Try this instead:
gst_object_unref(GST_OBJECT(pipeline)*)*;

Calling g_main_loop_quit at this point makes your main() func to return
and so resources are freed (including pipeline), so trying to access
them with gst_element_set_state falls into segv.
Call g_main_loop_quit after gst_object_unref(GST_OBJECT(pipeline)) instead.

-- 
Yann Gilquin

Purple Labs S.A.
www.purplelabs.com






More information about the gstreamer-devel mailing list