g_main_loop hangs

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

g_main_loop hangs

Hello all. 

I have some application, which receives the stream from rtsp and dumps it to the files. 
Method is like this:
Left pipe part:
rtspsrc -> rtph264depay -> appsink(samples)-> [handmadebuffer] 
Right pipe part:
[handmadebuffer] -> appsrc(samples)->h264parse->splitmuxsink.
It working fine. When I want to stop just Right part I'm calling 
gst_element_send_event (pipeline, gst_event_new_eos());
And it works fine. The Right part pipe correctly finishes.  
I have Bus_on_message callbacks which process EOS and ERROR messages and it works fine for both pipes.
When I just plug-off my rtsp source (pull-out network cable) I have the correct EOS message for Left pipe and from my on_eos_message callback for Left pipe, I call gst_element_send_event (pipeline, gst_event_new_eos()) for my Right pipe. And the magic begins to happen... g_main_loop for Right pipe just hangs. No EOS messages for Right pipe. Nothing. Using gdb I've attached to my app and made a bt for that thread:
(gdb) bt
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ff9e3c15483 in g_cond_wait () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ff9e3bc5105 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ff9e3bc8598 in g_main_loop_run () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0

Here is bt head above my functions.

Does anybody know how to proceed with this? Googe did not help much with this :(

Thank you in advance,
Best regards,

gstreamer-devel mailing list
[hidden email]