<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">I think the code maybe looks like,<br><br> GstStateChangeReturn ret_get_state;<br> GstState state;<br><pre> if (player->pipeline)<br> {<br> gst_element_set_state (player->pipeline, GST_STATE_NULL);<br> while (ret_get_state = gst_element_get_state(bin, &state, NULL, 1<br>                                        * GST_SECOND) != GST_STATE_CHANGE_FAILURE)<br> {<br> if ( GST_STATE_NULL == state)<br> {<br> break;<br> }<br> }<br> <br> g_object_unref (player->pipeline);<br> player->pipeline = NULL;<br> }<br></pre><div></div><div id="divNeteaseMailCard"></div>At 2011-12-28 17:29:24,forestzhu <forest0823@126.com> wrote:
>Hi all,
>I met trouble in gsteamer program.
>Sometimes the program will crash
>when I use the " gst_element_set_state" to set the pipeline to NULL .
>
>my code likes below:
>
> if (player->pipeline)
> {
> DEBUG_LOG("pipeline=>%p ...",player->pipeline);
>while(GST_STATE_CHANGE_FAILURE == gst_element_set_state (player->pipeline,
>GST_STATE_NULL))
> DEBUG_LOG("fail to change pipeline state...");
>DEBUG_LOG("after set state");
> sleep(1);
>
> g_object_unref (player->pipeline);
> player->pipeline = NULL;
> }
>
>I confirmed before set_state the player->pipeline 's mem_address is correct
>.
>And the "DEBUG_LOG("fail to change pipeline state...");" and
>"DEBUG_LOG("after set state");" will not run.
>
>Anyone can give me some informations?
>
>Thanks for any hint!
>
>Regards!
>
>
>forest
>
>
>
>
>--
>View this message in context: http://gstreamer-devel.966125.n4.nabble.com/The-problem-about-gst-element-set-state-tp4239421p4239421.html
>Sent from the GStreamer-devel mailing list archive at Nabble.com.
>_______________________________________________
>gstreamer-devel mailing list
>gstreamer-devel@lists.freedesktop.org
>http://lists.freedesktop.org/mailman/listinfo/gstreamer-dev
</div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>