<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2014-02-17 12:59 GMT-03:00 Krzysztof Borowczyk <span dir="ltr"><<a href="mailto:k.borowczyk@samsung.com" target="_blank">k.borowczyk@samsung.com</a>></span>:<br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow:hidden">t_sync_state_with_parent(branch);</div></blockquote></div><br>
</div>I had some trouble with videomixer and dynamic releasing of pads. Maybe is similar to your case.<br>My pipe is a videomixer with 2 filesrc inputs. When I change one of the inputs, the pipeline freezes because of deadlock (this occurs sometimes).<br>


Tracing the videomixer and collectpads code I found that the deadlock was produced by the chain function of one of the sinks (on collectpads.c) and the release_request_pad code on the other sink_pad (on videomixer.c).<br>


<br>I don't remember exactly the  code but the problem occurs when this sequence succeeds:<br><br>1) gst_collect_pads_chain function acquires GST_COLLECT_PADS_STREAM_LOCK.<br>2) gst_videomixer2_release_pad function acquires GST_VIDEO_MIXER2_LOCK.<br>


2 )gst_collect_pads_chain function calls to gst_videomixer2_collected() function.<br>3) gst_videomixer2_collected() function tries to acquire GST_VIDEO_MIXER2_LOCK.<br>4) gst_videomixer2_release_pad() function tries to acquire GST_COLLECT_PADS_STREAM_LOCK.<br>


<br>So, gst_videomixer2_release_pad waits on COLLECT_PADS_STREAM_LOCK (acquired by gst_videomixer2_collected) and gst_videomixer2_collected waits on GST_VIDEO_MIXER2_LOCK(acquired by gst_videomixer2_release_pad).<br><br>

I've also attached an <a href="https://bugzilla.gnome.org/show_bug.cgi?id=701110" target="_blank">example</a> that reproduces this behaviour. Sometimes this example produces a segfault. When the segfault doesn't occurs the videomixer runs a nondeterministic amount of time and then freezes.<br>


<br>If the gstreamer's guys want I can create a new bug or update the already uploaded bug.<br>Also I can try to make a fix.<br><br>Hope it helps.<br><br>P.D: on this <a href="http://gstreamer-devel.966125.n4.nabble.com/gst-1-2-2-remove-a-request-pad-from-videomixer-cause-SEGFAULT-td4664827.html" target="_blank">thread</a> I've talked with sebastian about this.<div class="gmail_extra">



<br></div></div>