]> git.sesse.net Git - ffmpeg/commitdiff
ffmpeg_vaapi: Unreference global device before setting it
authorMark Thompson <sw@jkqxz.net>
Sun, 22 Jan 2017 18:48:51 +0000 (18:48 +0000)
committerMark Thompson <sw@jkqxz.net>
Sun, 5 Feb 2017 15:13:15 +0000 (15:13 +0000)
This currently leaks if multiple device options are specified on the
command line.

ffmpeg_vaapi.c

index b9ad7adee9a2a91d7437004454b2f9c8c0df1471..6530908ef4352106a2aff5976065bb0a3b76e388 100644 (file)
@@ -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) {