<div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Thanks!</div>

<div>It seems to work better.  I noticed though that both logging function are active in that case (tested ith a standalone application).</div>

<div> </div>

<div>The crashing does never happend in a standalone application, so unfortunetly i cannot reproduce it there.  It may also arrise from multiple calling, so I added a protection like so:</div>

<div><span style=" color:#808000;">if</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(!</span><span style=" color:#000000;">gst_is_initialized</span><span style=" color:#000000;">())</span>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">{</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">         </span><span style=" color:#000000;">gst_debug_set_default_threshold</span><span style=" color:#000000;">(</span><span style=" color:#800080;">GST_LEVEL_LOG</span><span style=" color:#000000;">);</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">         </span><span style=" color:#000000;">gst_debug_add_log_function</span><span style=" color:#000000;">(&</span>gstLogFunction<span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">NULL</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">NULL</span><span style=" color:#000000;">);</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">         </span><span style=" color:#000000;">gst_debug_remove_log_function</span><span style=" color:#000000;">(&</span>gst_debug_log_default<span style=" color:#000000;">);</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">         </span><span style=" color:#000000;">gst_init</span><span style=" color:#000000;">(</span><span style=" color:#000080;">NULL</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">NULL</span><span style=" color:#000000;">);</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">}</span></pre>
</div>

<div> </div>

<div>BR</div>

<div> 
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Dienstag, 05. Januar 2016 um 14:06 Uhr<br/>
<b>Von:</b> "Sebastian Dröge-3 [via GStreamer-devel]" <<a href="/user/SendEmail.jtp?type=node&node=4675119&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>><br/>
<b>An:</b> pfarmer <<a href="/user/SendEmail.jtp?type=node&node=4675119&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a>><br/>
<b>Betreff:</b> Re: Aw: Re: GStreamer application access violation in random locations</div>

<div name="quoted-content">On Di, 2016-01-05 at 04:36 -0800, pfarmer wrote:
<div class="shrinkable-quote">
<div class="shrinkable-quote"><br/>
> Hello,<br/>
>  <br/>
> I am not able to crash the function I posted before earlier. It<br/>
> crashed for sure once, but it may have been realated to some logging<br/>
> initialization that were still in memory at Simulink. So I narrowed<br/>
> it down to the debugging functions of gstreamer. Here the new minimal<br/>
> s-function that crashes every now and then:<br/>
>  [...]<br/>
>  <br/>
> Note that it also crashes with the empty gstLogFunction().<br/>
> I would like however "redirect" the the gstreamer messages to the<br/>
> Simulink output. So I would like to use those functions.<br/>
> Does someone know what I could do to avoid the crashing?</div>
</div>
This probably does not crash if you first add your log function, then<br/>
remove the old one and only then call gst_init(). And make sure that<br/>
these 3 things are only ever done once per process.<br/>
<br/>
That's only a workaround though, somewhere there is a bug hiding. Can<br/>
you also reproduce this in a standalone application? <br/>
<br/>
--<br/>
Sebastian Dröge, Centricular Ltd · <a href="http://www.centricular.com" target="_blank" rel="nofollow" link="external">http://www.centricular.com</a><br/>
<br/>
<br/>
_______________________________________________<br/>
gstreamer-devel mailing list<br/>
<a target="_top" rel="nofollow" link="external">[hidden email]</a><br/>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank" rel="nofollow" link="external">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>

<div class="small"><br/>
<img src="http://gstreamer-devel.966125.n4.nabble.com/images/icon_attachment.gif"/> <strong>signature.asc</strong> (968 bytes) <a href="http://gstreamer-devel.966125.n4.nabble.com/attachment/4675117/0/signature.asc" target="_blank" rel="nofollow" link="external">Download Attachment</a></div>
 

<hr noshade="noshade" size="1"/>
<div style="color: rgb(68,68,68);font: 12.0px tahoma , geneva , helvetica , arial , sans-serif;">
<div style="font-weight: bold;">If you reply to this email, your message will be added to the discussion below:</div>
<a href="http://gstreamer-devel.966125.n4.nabble.com/GStreamer-application-access-violation-in-random-locations-tp4674999p4675117.html" target="_blank" rel="nofollow" link="external">http://gstreamer-devel.966125.n4.nabble.com/GStreamer-application-access-violation-in-random-locations-tp4674999p4675117.html</a></div>

<div style="color: rgb(102,102,102);font: 11.0px tahoma , geneva , helvetica , arial , sans-serif;margin-top: 0.4em;line-height: 1.5em;">To start a new topic under GStreamer-devel, email <a href="/user/SendEmail.jtp?type=node&node=4675119&i=2" target="_top" rel="nofollow" link="external">[hidden email]</a><br/>
To unsubscribe from GStreamer application access violation in random locations, <a href="" target="_blank" rel="nofollow" link="external">click here</a>.<br/>
<a href="http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" style="font: 9.0px serif;" target="_blank" rel="nofollow" link="external">NAML</a></div>
</div>
</div>
</div>
</div></div>


        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/GStreamer-application-access-violation-in-random-locations-tp4674999p4675119.html">Aw: Re:  Re: GStreamer application access violation in random locations</a><br/>
Sent from the <a href="http://gstreamer-devel.966125.n4.nabble.com/">GStreamer-devel mailing list archive</a> at Nabble.com.<br/>