<pre><code><font style="font-family:arial,helvetica,sans-serif" size="2">Hi all,<br><br>I constructed a pipeline using playbin to play mp3 files.<br>All works well, but sometimes I have a crash at the end of the paying when I try to unref the playbin element.<br>
</font><br><font style="font-family:arial,helvetica,sans-serif" size="2">Here is the piece of code I used to unref playbin :<br><br></font></code><code><font style="font-family:arial,helvetica,sans-serif" size="2"><code></code></font>GstStateChangeReturn ret = gst_element_set_state (playbinElement, GST_STATE_NULL); // </code><code></code><code>playbinElement</code><code> is a pointer on the playbin element</code><code> (</code><code><font style="font-family:arial,helvetica,sans-serif" size="2">GstElement *</font></code><code>playbinElement = </code><code><font style="font-family:arial,helvetica,sans-serif" size="2"><code>gst_element_factory_make ("playbin", "playElement")</code></font></code><code>)<br>
<br>GstClockTime timeOut = 2000000000; // in nano seconds<br>
if (ret==GST_STATE_CHANGE_ASYNC)
{<br>    printf("set state async\n");<br>    ret = gst_element_get_state(</code><code>playbinElement</code><code>,NULL,NULL,timeOut);<br>}<br>if (ret==GST_STATE_CHANGE_SUCCESS)
{<br>    printf("set state done\n");<br>    gst_object_unref(GST_OBJECT (</code><code>playbinElement</code><code>));<br>    printf("unref done\n");<br>}<br>else
{<br>    printf("set state failed\n");<br>}</code><br><br><code><font style="font-family:arial,helvetica,sans-serif" size="2">And I have the following backtrace :</font></code></pre>


        <p></p>


        <p>set state done<br>unref done<br></p>


        <p>(<unknown>:4379): GStreamer-CRITICAL *<b>: gst_element_set_state: assertion `GST_IS_ELEMENT (element)' failed<br>(<unknown>:4379): GStreamer-CRITICAL *</b>:<br>Trying to dispose element play, but it is in PAUSED instead of the NULL state.<br>

You need to explicitly set elements to the NULL state before<br>dropping the final reference, to allow them to clean up.<br>This problem may also be caused by a refcounting bug in the<br>application or some element.<br>(<unknown>:4379): GStreamer-CRITICAL *<b>:<br>

Trying to dispose element preroll_audio_src0, but it is in PAUSED instead of the NULL state.<br>You need to explicitly set elements to the NULL state before<br>dropping the final reference, to allow them to clean up.<br>
This problem may also be caused by a refcounting bug in the<br>
application or some element.<br>GThread-ERROR *</b>:
 file gthread-posix.c: line 171 (g_mutex_free_posix_impl): error 'Device
 or resource busy' during 'pthread_mutex_destroy ((pthread_mutex_t *) 
mutex)'<br>aborting...<br>Aborted</p><p></p><p>Does someone know from where could come the problem ?</p><p></p><p>Thanks in advance</p><p>Regards</p><p>Vincent<br></p><p><br></p><p><br></p>