[vlc-devel] [PATCH 5/8] avcodec: video: check the va chroma directly

Steve Lhomme robux4 at videolabs.io
Fri May 5 18:42:21 CEST 2017


The va chroma is set before, when calling lavc_GetVideoFormat(), no need to
read it again.
The value will be set on the decoder output in lavc_UpdateVideoFormat().
---
 modules/codec/avcodec/video.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 0a5dad39fc..fc28055b2e 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -396,11 +396,9 @@ static int OpenVideoCodec( decoder_t *p_dec )
 }
 
 static int SetupHardwareFormat(decoder_t *p_dec, AVCodecContext *p_context,
-                               enum AVPixelFormat hwfmt, enum AVPixelFormat swfmt,
-                               video_format_t *fmt_out)
+                               enum AVPixelFormat hwfmt, video_format_t *fmt_out)
 {
-    p_dec->fmt_out.video.i_chroma = vlc_va_GetChroma(hwfmt, swfmt);
-    if (p_dec->fmt_out.video.i_chroma == 0)
+    if (fmt_out->i_chroma == 0)
         return VLC_EGENERIC; /* Unknown brand of hardware acceleration */
     if (p_context->width == 0 || p_context->height == 0)
     {   /* should never happen */
@@ -1510,7 +1508,7 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
         video_format_t fmt_out;
         if (lavc_GetVideoFormat(p_dec, &fmt_out, p_context, pi_fmt[i], swfmt))
             continue;
-        if (SetupHardwareFormat(p_dec, p_context, pi_fmt[i], swfmt, &fmt_out))
+        if (SetupHardwareFormat(p_dec, p_context, pi_fmt[i], &fmt_out))
             continue;
 
         return pi_fmt[i];
-- 
2.12.1



More information about the vlc-devel mailing list