summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2017-05-26 17:52:19 +0200
committerEdward Hervey <bilboed@bilboed.com>2017-05-26 17:52:19 +0200
commit246f21ac2fc8c2c1ec00b378f5af7b1eb3666e1c (patch)
treed8285dec05740ecce925678409a7f7d91060a8ba
parentefebda5a34de5c24c91fb77ca71903c24ee83c97 (diff)
v4l2videoenc: Don't leak VideoCodecState
CID #1409852
-rw-r--r--sys/v4l2/gstv4l2videoenc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/v4l2/gstv4l2videoenc.c b/sys/v4l2/gstv4l2videoenc.c
index 4123e3b67..e0e8e0030 100644
--- a/sys/v4l2/gstv4l2videoenc.c
+++ b/sys/v4l2/gstv4l2videoenc.c
@@ -305,6 +305,7 @@ gst_v4l2_video_enc_set_format (GstVideoEncoder * encoder,
GstV4l2VideoEnc *self = GST_V4L2_VIDEO_ENC (encoder);
GstV4l2Error error = GST_V4L2_ERROR_INIT;
GstCaps *outcaps;
+ GstVideoCodecState *output;
GST_DEBUG_OBJECT (self, "Setting format: %" GST_PTR_FORMAT, state->caps);
@@ -323,7 +324,8 @@ gst_v4l2_video_enc_set_format (GstVideoEncoder * encoder,
outcaps = gst_pad_get_pad_template_caps (encoder->srcpad);
outcaps = gst_caps_make_writable (outcaps);
- gst_video_encoder_set_output_state (encoder, outcaps, state);
+ output = gst_video_encoder_set_output_state (encoder, outcaps, state);
+ gst_video_codec_state_unref (output);
if (!gst_video_encoder_negotiate (encoder))
return FALSE;