diff options
author | sfan5 <sfan5@live.de> | 2023-02-24 23:12:22 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-02-26 16:40:59 +0100 |
commit | 5a83745316c7b2b3d4a1cea27bf3580252ef7708 (patch) | |
tree | 2ce53d4c22e54877e15344eb30ad854e6bc5b980 /video/decode | |
parent | 1dda09b8179139b2ae5e59f3ae086b2905e0fc7a (diff) | |
download | mpv-5a83745316c7b2b3d4a1cea27bf3580252ef7708.tar.bz2 mpv-5a83745316c7b2b3d4a1cea27bf3580252ef7708.tar.xz |
vd_lavc: sort hwdecs without hwdevices last for autoprobing
For hwdecs without devices we can't get instant feedback during probing
whether the hwdec can possibly work or not, so we definitely want to try them last.
Independently this would also have solved the issue addressed by the previous commit.
Diffstat (limited to 'video/decode')
-rw-r--r-- | video/decode/vd_lavc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 6efe5deb06..020ae6a991 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -267,6 +267,9 @@ static int hwdec_compare(const void *p1, const void *p2) // Order by autoprobe preference order. if (h1->auto_pos != h2->auto_pos) return h1->auto_pos > h2->auto_pos ? 1 : -1; + // Put hwdecs without hw_device_ctx last + if ((!!h1->lavc_device) != (!!h2->lavc_device)) + return h1->lavc_device ? -1 : 1; // Fallback sort order to make sorting stable. return h1->rank > h2->rank ? 1 :-1; } |