<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">In gst_video_encoder_chain(), the “frame” is “ref” before appending to frame list.<div class="">So ref-count is increased in the list.<br class=""><div class=""><br class=""></div><div class="">gst_video_codec_frame_ref (frame);</div><div class="">priv->frames = g_list_append (priv->frames, frame);</div><div class=""><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">--</div><div class="">Yi-Lung (Bruce) Tsai</div><div class=""><a href="mailto:wagamama.tsai@gmail.com" class="">wagamama.tsai@gmail.com</a></div><div class=""><br class=""></div></div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On May 4, 2017, at 3:27 AM, Martin Maurer <<a href="mailto:meinemailingliste2@online.de" class="">meinemailingliste2@online.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi,<br class=""><br class="">the following is an extract from gst-plugins-base-1.0-1.11.91\gst-libs\gst\video\gstvideoencoder.c<br class=""><br class="">static void<br class="">gst_video_encoder_release_frame (GstVideoEncoder * enc,<br class="">    GstVideoCodecFrame * frame)<br class="">{<br class="">  GList *link;<br class=""><br class="">  /* unref once from the list */<br class="">  link = g_list_find (enc->priv->frames, frame);<br class="">  if (link) {<br class="">    gst_video_codec_frame_unref (frame);<br class="">    enc->priv->frames = g_list_delete_link (enc->priv->frames, link);<br class="">  }<br class="">  /* unref because this function takes ownership */<br class="">  gst_video_codec_frame_unref (frame);<br class="">}<br class=""><br class="">Could there be an error, because the "unref" command is executed twice. And both time with same parameter "frame".<br class="">Is there perhaps a missing return or else statement needed?<br class="">Must "frame" in first unref command be "link", or link maybe ok, because link is the same as frame, in case it is found?<br class=""><br class="">Best regards,<br class=""><br class="">Martin<br class=""><br class=""><br class="">_______________________________________________<br class="">gstreamer-devel mailing list<br class=""><a href="mailto:gstreamer-devel@lists.freedesktop.org" class="">gstreamer-devel@lists.freedesktop.org</a><br class="">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel<br class=""></div></div></blockquote></div><br class=""></div></div></body></html>