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

Yann Gilquin yann.gilquin at purplelabs.com
Wed Jul 18 19:09:33 CEST 2007


Pritesh Kumar wrote:
> hi ,
> still is creating the same problem 
>
> -----Original Message-----
> From: gstreamer-devel-bounces at lists.sourceforge.net
> [mailto:gstreamer-devel-bounces at lists.sourceforge.net]On Behalf Of Yann
> Gilquin
> Sent: Wednesday, July 18, 2007 5:48 PM
> To: digitaldsp at excite.com
> Cc: gstreamer-devel at lists.sourceforge.net
> Subject: Re: [gst-devel] seg fault: on
> gst_element_set_state(pipeline,GST_STATE_READY)
>
>
> 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.
>
>   

Please include the whole mailing_list in replies. Some people could be
interested by your problem.

ok, note that the _set_state function is not synchronous. Thus it could
return GST_STATE_CHANGE_ASYNC immediately, even if state changes have
not been achieved. In your case, check its return to check if it's not
still running as you call g_main_loop_quit.

-- 
Yann Gilquin

Purple Labs S.A.
www.purplelabs.com






More information about the gstreamer-devel mailing list