ffmpeg_vaapi: Unreference global device before setting it

This currently leaks if multiple device options are specified on the
command line.
This commit is contained in:
Mark Thompson 2017-01-22 18:48:51 +00:00
parent fd57f70c97
commit df3b17eba4
1 changed files with 2 additions and 0 deletions

View 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) {