Send error instead of empty for known erroring hwaccel

This commit is contained in:
Nicolas Mowen 2023-01-06 09:14:29 -07:00 committed by GitHub
parent 7574b9e846
commit 26f3feea45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -123,7 +123,7 @@ async def set_gpu_stats(
if isinstance(args, list):
args = " ".join(args)
if args and args not in hwaccel_args and args not in hwaccel_errors:
if args and args not in hwaccel_args:
hwaccel_args.append(args)
for stream_input in camera.ffmpeg.inputs:
@ -138,7 +138,10 @@ async def set_gpu_stats(
stats: dict[str, dict] = {}
for args in hwaccel_args:
if "cuvid" in args or "nvidia" in args:
if args in hwaccel_errors:
# known erroring args should automatically return as error
stats["error-gpu"] = {"gpu": -1, "mem": -1}
elif "cuvid" in args or "nvidia" in args:
# nvidia GPU
nvidia_usage = get_nvidia_gpu_stats()