[vlc-devel] [PATCH 1/3] avcodec:video: don't try hardware acceleration if "none" is enabled

Steve Lhomme robux4 at videolabs.io
Fri Aug 4 14:54:55 CEST 2017


---
 modules/codec/avcodec/video.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 590aa9460f..14668db0c4 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -1490,6 +1490,14 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
             can_hwaccel = true;
     }
 
+    char * var = var_InheritString(p_dec, "avcodec-hw");
+    if (var == NULL || !strcmp( var, "none" ))
+    {
+        msg_Dbg( p_dec, "disable hardware decoders" );
+        can_hwaccel = false;
+    }
+    free(var);
+
     /* If the format did not actually change (e.g. seeking), try to reuse the
      * existing output format, and if present, hardware acceleration back-end.
      * This avoids resetting the pipeline downstream. This also avoids
-- 
2.12.1



More information about the vlc-devel mailing list