[vlc-commits] directx_va: also check avctx profile

Thomas Guillem git at videolan.org
Mon Mar 5 09:28:52 CET 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Mar  1 18:06:21 2018 +0100| [f11f607711eca522fcd2790081d3fdfb0a920ea4] | committer: Thomas Guillem

directx_va: also check avctx profile

Better to get all chances to get a profile.

(cherry picked from commit 1ab0330d135c5e083cb4c4139a28d8778a7ffb43)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=f11f607711eca522fcd2790081d3fdfb0a920ea4
---

 modules/codec/avcodec/directx_va.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/codec/avcodec/directx_va.c b/modules/codec/avcodec/directx_va.c
index 3efed0f1f0..eb00abb6c7 100644
--- a/modules/codec/avcodec/directx_va.c
+++ b/modules/codec/avcodec/directx_va.c
@@ -350,12 +350,13 @@ error:
     return VLC_EGENERIC;
 }
 
-static bool profile_supported(const directx_va_mode_t *mode, const es_format_t *fmt)
+static bool profile_supported(const directx_va_mode_t *mode, const es_format_t *fmt,
+                              const AVCodecContext *avctx)
 {
     bool is_supported = mode->p_profiles == NULL || !mode->p_profiles[0];
     if (!is_supported)
     {
-        int profile = fmt->i_profile;
+        int profile = fmt->i_profile >= 0 ? fmt->i_profile : avctx->profile;
         if (mode->codec == AV_CODEC_ID_H264)
         {
             uint8_t h264_profile;
@@ -420,7 +421,7 @@ static int FindVideoServiceConversion(vlc_va_t *va, directx_sys_t *dx_sys,
         }
         if ( is_supported )
         {
-            is_supported = profile_supported( mode, fmt );
+            is_supported = profile_supported( mode, fmt, avctx );
             if (!is_supported)
                 msg_Warn( va, "Unsupported profile %d for %s ",
                           fmt->i_profile, directx_va_GetDecoderName(mode->guid) );



More information about the vlc-commits mailing list