mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
videoencoder: Don't unref frame twice if not in the list
This commit is contained in:
parent
e316ff5435
commit
86b36c3463
1 changed files with 8 additions and 4 deletions
|
@ -1496,10 +1496,14 @@ gst_video_encoder_finish_frame (GstVideoEncoder * encoder,
|
||||||
|
|
||||||
done:
|
done:
|
||||||
/* handed out */
|
/* handed out */
|
||||||
priv->frames = g_list_remove (priv->frames, frame);
|
|
||||||
/* Remove the reference from the list and the reference that
|
/* unref once from the list */
|
||||||
* was provided to us */
|
l = g_list_find (priv->frames, frame);
|
||||||
gst_video_codec_frame_unref (frame);
|
if (l) {
|
||||||
|
gst_video_codec_frame_unref (frame);
|
||||||
|
priv->frames = g_list_delete_link (priv->frames, l);
|
||||||
|
}
|
||||||
|
/* unref because this function takes ownership */
|
||||||
gst_video_codec_frame_unref (frame);
|
gst_video_codec_frame_unref (frame);
|
||||||
|
|
||||||
GST_VIDEO_ENCODER_STREAM_UNLOCK (encoder);
|
GST_VIDEO_ENCODER_STREAM_UNLOCK (encoder);
|
||||||
|
|
Loading…
Reference in a new issue