Is the code in gst_video_encoder_release_frame correct?

Martin Maurer meinemailingliste2 at online.de
Wed May 3 19:27:13 UTC 2017


Hi,

the following is an extract from 
gst-plugins-base-1.0-1.11.91\gst-libs\gst\video\gstvideoencoder.c

static void
gst_video_encoder_release_frame (GstVideoEncoder * enc,
     GstVideoCodecFrame * frame)
{
   GList *link;

   /* unref once from the list */
   link = g_list_find (enc->priv->frames, frame);
   if (link) {
     gst_video_codec_frame_unref (frame);
     enc->priv->frames = g_list_delete_link (enc->priv->frames, link);
   }
   /* unref because this function takes ownership */
   gst_video_codec_frame_unref (frame);
}

Could there be an error, because the "unref" command is executed twice. 
And both time with same parameter "frame".
Is there perhaps a missing return or else statement needed?
Must "frame" in first unref command be "link", or link maybe ok, because 
link is the same as frame, in case it is found?

Best regards,

Martin




More information about the gstreamer-devel mailing list