avvidenc: Close reference context before freeing it

Otherwise we'll leak some memory.

See https://gitlab.freedesktop.org/gstreamer/gst-libav/merge_requests/32
This commit is contained in:
Sebastian Dröge 2019-07-15 10:42:42 +03:00
parent 456e812c28
commit 4d3cd3983a

View file

@ -221,6 +221,7 @@ gst_ffmpegvidenc_finalize (GObject * object)
/* clean up remaining allocated data */ /* clean up remaining allocated data */
av_frame_free (&ffmpegenc->picture); av_frame_free (&ffmpegenc->picture);
gst_ffmpeg_avcodec_close (ffmpegenc->context); gst_ffmpeg_avcodec_close (ffmpegenc->context);
gst_ffmpeg_avcodec_close (ffmpegenc->refcontext);
av_free (ffmpegenc->context); av_free (ffmpegenc->context);
av_free (ffmpegenc->refcontext); av_free (ffmpegenc->refcontext);