[vlc-commits] [Git][videolan/vlc][master] 2 commits: directx_va: don't discard profile values set to 0

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Oct 31 09:28:17 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
080404a0 by Steve Lhomme at 2024-10-31T09:08:10+00:00
directx_va: don't discard profile values set to 0

FF_PROFILE_VP9_0 and FF_PROFILE_AV1_MAIN are 0.
We should only assume we don't know the profile when it's neither
set in our es_format_t nor in the AVCodecContext::profile.

- - - - -
5f906939 by Steve Lhomme at 2024-10-31T09:08:10+00:00
directx_va: don't use hardware decoding without the decoder profile

If the decoder is only valid for certain profiles, we should not
use that decoder if we can't guarantee the profile matches.

- - - - -


1 changed file:

- modules/codec/avcodec/directx_va.c


Changes:

=====================================
modules/codec/avcodec/directx_va.c
=====================================
@@ -431,7 +431,13 @@ static bool profile_supported(const directx_va_mode_t *mode, const es_format_t *
     if (mode->p_profiles == NULL)
         return true;
 
-    int profile = fmt->i_profile >= 0 ? fmt->i_profile : avctx->profile;
+    int profile;
+    if (fmt->i_profile >= 0)
+        profile = fmt->i_profile;
+    else if (avctx->profile != FF_PROFILE_UNKNOWN)
+        profile = avctx->profile;
+    else
+        profile = -1;
     if (mode->codec == AV_CODEC_ID_H264 && profile == -1)
     {
         uint8_t h264_profile;
@@ -446,9 +452,8 @@ static bool profile_supported(const directx_va_mode_t *mode, const es_format_t *
     }
 
     bool is_supported = false;
-    if (profile <= 0)
-        is_supported = true;
-    else for (const int *p_profile = &mode->p_profiles[0]; *p_profile != FF_PROFILE_UNKNOWN; ++p_profile)
+    if (profile != -1)
+    for (const int *p_profile = &mode->p_profiles[0]; *p_profile != FF_PROFILE_UNKNOWN; ++p_profile)
     {
         if (*p_profile == profile)
         {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/def188d3189df043a1ec0f40901aa134a8c83c91...5f906939b40e8d004944949df8ca77758ac05fc7

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/def188d3189df043a1ec0f40901aa134a8c83c91...5f906939b40e8d004944949df8ca77758ac05fc7
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list