Skip to content

Commit 106bbc7

Browse files
committed
fixed lavd always selected
Fixes the commit b62566c (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.
1 parent fb919ec commit 106bbc7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/video_decompress/libavcodec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,8 @@ static int libavcodec_decompress_get_priority(codec_t compression, struct pixfmt
11561156
PRIO_LOWER = 800,
11571157
PRIO_LO = 900,
11581158
};
1159-
if (hw_accel_to_ug_pixfmt(internal.accel_type) == ugc) {
1159+
if (internal.accel_type != HWACCEL_NONE &&
1160+
hw_accel_to_ug_pixfmt(internal.accel_type) == ugc) {
11601161
return PRIO_HI;
11611162
}
11621163

0 commit comments

Comments
 (0)