[FFmpeg-cvslog] ffmpeg_vaapi: Unreference global device before setting it

Mark Thompson git at videolan.org
Sun Feb 5 17:41:48 EET 2017


ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Sun Jan 22 18:48:51 2017 +0000| [df3b17eba47e635a694acb18b74e389194355f45] | committer: Mark Thompson

ffmpeg_vaapi: Unreference global device before setting it

This currently leaks if multiple device options are specified on the
command line.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=df3b17eba47e635a694acb18b74e389194355f45
---

 ffmpeg_vaapi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ffmpeg_vaapi.c b/ffmpeg_vaapi.c
index b9ad7ad..6530908 100644
--- a/ffmpeg_vaapi.c
+++ b/ffmpeg_vaapi.c
@@ -220,6 +220,8 @@ av_cold int vaapi_device_init(const char *device)
 {
     int err;
 
+    av_buffer_unref(&hw_device_ctx);
+
     err = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI,
                                  device, NULL, 0);
     if (err < 0) {



More information about the ffmpeg-cvslog mailing list