fixed lavd always selected

Fixes the commit b62566ca72 (2th Oct 2023), which caused that lavd was
always selected as the decoder, even though not designated. Eg.:
```
$ uv -t testcard:codec=I420 -d gl
Decompressor "libavcodec" initialized successfully.
[lavd] Unsupported codec!!!
```

The problem was that on probe ugc==VC_NONE and HW acceleration is not
set, thus hw_accel_to_ug_pixfmt(0) return also VC_NONE, in which case
the decoder is unconditionally selected for all formats.
This commit is contained in:
Martin Pulec
2024-01-30 10:05:23 +01:00
parent fb919ec216
commit 106bbc7e8f

View File

@@ -1156,7 +1156,8 @@ static int libavcodec_decompress_get_priority(codec_t compression, struct pixfmt
PRIO_LOWER = 800,
PRIO_LO = 900,
};
if (hw_accel_to_ug_pixfmt(internal.accel_type) == ugc) {
if (internal.accel_type != HWACCEL_NONE &&
hw_accel_to_ug_pixfmt(internal.accel_type) == ugc) {
return PRIO_HI;
}