diff options
author | Mark Thompson <sw@jkqxz.net> | 2020-04-13 16:33:21 +0100 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2020-04-26 18:38:25 +0100 |
commit | 79c173cc1900c735b1e256f5755b3e434a080a4f (patch) | |
tree | 9bb8fdd3d996f43cf3f5f5e851595e380c62c46e /fftools/ffmpeg_opt.c | |
parent | 8abd3b202821e9c491f44d097686402aafdda7c5 (diff) |
ffmpeg: Remove the hw_device_ctx global
The ad-hoc libmfx setup code is the only place its still used, so move it
into that file.
Diffstat (limited to 'fftools/ffmpeg_opt.c')
-rw-r--r-- | fftools/ffmpeg_opt.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 680f0f1dfb..16e321b5a3 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -139,7 +139,6 @@ const HWAccel hwaccels[] = { #endif { 0 }, }; -AVBufferRef *hw_device_ctx; HWDevice *filter_hw_device; char *vstats_filename; @@ -536,21 +535,15 @@ static int opt_sdp_file(void *optctx, const char *opt, const char *arg) #if CONFIG_VAAPI static int opt_vaapi_device(void *optctx, const char *opt, const char *arg) { - HWDevice *dev; const char *prefix = "vaapi:"; char *tmp; int err; tmp = av_asprintf("%s%s", prefix, arg); if (!tmp) return AVERROR(ENOMEM); - err = hw_device_init_from_string(tmp, &dev); + err = hw_device_init_from_string(tmp, NULL); av_free(tmp); - if (err < 0) - return err; - hw_device_ctx = av_buffer_ref(dev->device_ref); - if (!hw_device_ctx) - return AVERROR(ENOMEM); - return 0; + return err; } #endif |