[vlc-devel] commit: Called vlc_va_Setup as soon as possible (avcodec). (Laurent Aimar )

git version control git at videolan.org
Wed Nov 25 22:30:46 CET 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Nov 14 22:17:47 2009 +0100| [106208c9f7b439cd590c4a9e95cf4edf41c8d752] | committer: Laurent Aimar 

Called vlc_va_Setup as soon as possible (avcodec).

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

 modules/codec/avcodec/video.c |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 17ff7ff..5971005 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -1146,13 +1146,27 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_codec,
             continue;
         }
 
+        if( p_sys->p_va &&
+            p_sys->p_context->width > 0 && p_sys->p_context->height > 0 )
+        {
+            /* We try to call vlc_va_Setup when possible to detect errors when
+             * possible (later is too late) */
+            if( vlc_va_Setup( p_sys->p_va,
+                              &p_sys->p_context->hwaccel_context,
+                              &p_dec->fmt_out.video.i_chroma,
+                              p_sys->p_context->width, p_sys->p_context->height ) )
+            {
+                msg_Err( p_dec, "vlc_va_Setup failed" );
+                vlc_va_Delete( p_sys->p_va );
+                p_sys->p_va = NULL;
+            }
+        }
+
         if( p_sys->p_va )
         {
             /* FIXME this will disabled direct rendering
              * even if a new pixel format is renegociated
-             *
-             * FIXME Try to call vlc_va_Setup when possible
-             * to detect errors when possible (later is too late) */
+             */
             p_sys->b_direct_rendering = false;
             p_sys->p_context->draw_horiz_band = NULL;
             return pi_fmt[i];




More information about the vlc-devel mailing list