<div dir="ltr">Hi,<br><br>I&#39;m new to gstreamer, so maybe I&#39;m doing something totally wrong here. <br>I have an SDL application (using SDL for  window, rendering and event handling), and I have a thread which uses gstreamer to play a video stream. In that thread I initialise the pipeline, create the main loop and run it. The video is playing fine on my SDL created window. <br>
The problem starts when I get libnotify involved. I use libnotify to post some kinds of notifications from the application. The notifications are posted from a different thread (not the video player thread), and also use glib and <font><font size="2">libdbus</font></font>. As soon as a notification is shown, the video thread exits (or sometime crashes). <br>
<br>
<div class="info">


</div> Probably there&#39;s some collision between libnotify &amp; gstreamer. They do have the same context, but the libnotify thread doesn&#39;t run his own main loop. 
Here&#39;s the trace for the relevant threads:

<p>The exiting thread, which run the video main loop:</p>

<hr>

<h1 style="font-family: times new roman,serif;"><font size="2">0  0xb6bcac34 in _exit () from /lib/tls/i686/cmov/libc.so.6</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">1  0xb691504d in ?? () from /lib/libdbus-1.so.3</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">2  0xb68f5e73 in ?? () from /lib/libdbus-1.so.3</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">3  0xb68f827b in ?? () from /lib/libdbus-1.so.3</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">4  0xb68f82fd in dbus_connection_send () from /lib/libdbus-1.so.3</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">5  0xb68f162c in ?? () from /lib/libdbus-1.so.3</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">6  0xb68f16a9 in dbus_bus_remove_match () from /lib/libdbus-1.so.3</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">7  0xb692f5db in ?? () from /usr/lib/libdbus-glib-1.so.2</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">8  0xb69311f9 in ?? () from /usr/lib/libdbus-glib-1.so.2</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">9  0xb6fd329f in g_object_run_dispose () from /usr/lib/libgobject-2.0.so.0</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">10 0xb693157b in ?? () from /usr/lib/libdbus-glib-1.so.2</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">11 0xb68f70d5 in dbus_connection_dispatch () from /lib/libdbus-1.so.3</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">12 0xb69286bd in ?? () from /usr/lib/libdbus-glib-1.so.2</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">13 0xb6f41b88 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">14 0xb6f450eb in ?? () from /usr/lib/libglib-2.0.so.0</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">15 0xb6f455ba in g_main_loop_run () from /usr/lib/libglib-2.0.so.0</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">16 0x0805135b in vp_thread_func (userdata=0x81b3948) at video_player/video_player.c:874</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">17 0xb6c944ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">18 0xb6c0f5ee in clone () from /lib/tls/i686/cmov/libc.so.6</font></h1>

<hr style="font-family: times new roman,serif;">

<p style="font-family: times new roman,serif;"><font size="2">The frame thread, which calls notify_notification_show:</font></p>

<hr style="font-family: times new roman,serif;">

<h1 style="font-family: times new roman,serif;"><font size="2">0  0xb690e6b6 in ?? () from /lib/libdbus-1.so.3</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">1  0xb690e09a in ?? () from /lib/libdbus-1.so.3</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">2  0xb690e111 in ?? () from /lib/libdbus-1.so.3</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">3  0xb690bd39 in ?? () from /lib/libdbus-1.so.3</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">4  0xb690c92e in ?? () from /lib/libdbus-1.so.3</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">5  0xb68f6bf8 in ?? () from /lib/libdbus-1.so.3</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">6  0xb68f8d98 in ?? () from /lib/libdbus-1.so.3</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">7  0xb68f8ef2 in ?? () from /lib/libdbus-1.so.3</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">8  0xb69061f1 in dbus_pending_call_block () from /lib/libdbus-1.so.3</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">9  0xb692e1cf in ?? () from /usr/lib/libdbus-glib-1.so.2</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">10 0xb692ec0e in dbus_g_proxy_call () from /usr/lib/libdbus-glib-1.so.2</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">11 0xb77cdb98 in notify_notification_show () from /usr/lib/libnotify.so.1</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">12 0x0804b91d in post_tray_notification (msg=0xb5409008 &quot;Test!&quot;) at unix_utils.c:277</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">13 0x0804c3a7 in handle_event_msg (msg=0xb46132b4, len=6) at scremote_client.c:504</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">14 0x0804ca5e in handle_msg (sock=7) at scremote_client.c:639</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">15 0x0804cb1f in wait_for_msg (sock=7) at scremote_client.c:657</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">16 0x0804dfb5 in frame_thread_func (dummy=0x0) at scremote_client.c:1466</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">17 0xb6c944ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0</font></h1>

<h1 style="font-family: times new roman,serif;"><font size="2">18 0xb6c0f5ee in clone () from /lib/tls/i686/cmov/libc.so.6</font></h1>Here&#39;s the code of the video initialisation:<br><br>******<br><br>static void* vp_thread_func(void* userdata)<br>
{<br><br>    vp_t* vp = (vp_t*)userdata;<br><br>    vp-&gt;thread_state = VP_THREAD_INITIALIZING;<br><br>    if(vp_init(vp)) {<br>        vp-&gt;thread_state = VP_THREAD_INITIALIZED;<br><br>        vp-&gt;loop = g_main_loop_new (NULL , FALSE);<br>
<br>        // Call our timer function every 500ms - this will be used to hide the cursor<br>        // when there is no input.<br>        g_timeout_add_full(G_PRIORITY_LOW, 500, &amp;vp_timer, (gpointer)vp, NULL);<br><br>
        syslog(LOG_INFO, &quot;Video player subsystem running.\n&quot;);<br><br>        g_main_loop_run(vp-&gt;loop);<br><br>        vp_remove(vp);<br><br>        vp-&gt;thread_state = VP_THREAD_UNINITIALIZED;<br><br>        if(vp-&gt;remove_request) {<br>
            g_free(vp);<br>            // Don&#39;t use vp beyond this point.<br>        }<br>    } else {<br>        syslog(LOG_ERR, &quot;Failed to initialize the video player subsystem.\n&quot;);<br>        vp-&gt;thread_state = VP_THREAD_INIT_ERROR;<br>
    }<br><br>    return NULL;<br>}<br><br>*****<br><br>Does anyone have an idea what causes the collision? Any suggestions? <br><br>Thanks,<br>Stas.<br><br><br></div>