diff options
author | Dudemanguy <random342@airmail.cc> | 2023-09-19 18:12:42 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-09-22 14:20:38 +0000 |
commit | db12a2f224239f1b2c1f58dc1feed9a1f4c8e553 (patch) | |
tree | 6cb5c0540a7d9064359d85ee39b3c079dc7d3c6c /video/cuda.c | |
parent | 73ad9eef2875247d38af99f4d8c804f2749a8588 (diff) | |
download | mpv-db12a2f224239f1b2c1f58dc1feed9a1f4c8e553.tar.bz2 mpv-db12a2f224239f1b2c1f58dc1feed9a1f4c8e553.tar.xz |
cuda: move --cuda-device to cuda_opts group
Also change a ta_free to talloc_free for consistency reasons.
Diffstat (limited to 'video/cuda.c')
-rw-r--r-- | video/cuda.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/video/cuda.c b/video/cuda.c index d83520bc83..3b7a2d882c 100644 --- a/video/cuda.c +++ b/video/cuda.c @@ -17,25 +17,24 @@ #include "hwdec.h" #include "options/m_config.h" +#include "options/options.h" #include <libavutil/hwcontext.h> static struct AVBufferRef *cuda_create_standalone(struct mpv_global *global, struct mp_log *log, struct hwcontext_create_dev_params *params) { - int decode_dev_idx; - mp_read_option_raw(global, "cuda-decode-device", &m_option_type_choice, - &decode_dev_idx); + struct cuda_opts *opts = mp_get_config_group(NULL, global, &cuda_conf); char *decode_dev = NULL; - if (decode_dev_idx != -1) { - decode_dev = talloc_asprintf(NULL, "%d", decode_dev_idx); - } + if (opts->cuda_device != -1) + decode_dev = talloc_asprintf(NULL, "%d", opts->cuda_device); AVBufferRef* ref = NULL; av_hwdevice_ctx_create(&ref, AV_HWDEVICE_TYPE_CUDA, decode_dev, NULL, 0); - ta_free(decode_dev); + talloc_free(decode_dev); + talloc_free(opts); return ref; } |