Commit 67a4c0c7 authored by Edward Hervey's avatar Edward Hervey Committed by Sebastian Dröge
Browse files

videoencoder: Add a reference to frame passed to subclass

We have one reference owned by the internal frame list and one reference
passed to the subclass.
parent 8217575a
......@@ -1185,6 +1185,7 @@ gst_video_encoder_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
GST_LOG_OBJECT (encoder, "passing frame pfn %d to subclass",
frame->presentation_frame_number);
gst_video_codec_frame_ref (frame);
ret = klass->handle_frame (encoder, frame);
done:
......@@ -1496,7 +1497,9 @@ gst_video_encoder_finish_frame (GstVideoEncoder * encoder,
done:
/* handed out */
priv->frames = g_list_remove (priv->frames, frame);
/* Remove the reference from the list and the reference that
* was provided to us */
gst_video_codec_frame_unref (frame);
gst_video_codec_frame_unref (frame);
GST_VIDEO_ENCODER_STREAM_UNLOCK (encoder);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment