]> git.sesse.net Git - vlc/commitdiff
Do not uselessly disable direct rendering in avcodec.
authorLaurent Aimar <fenrir@videolan.org>
Fri, 17 Jul 2009 17:06:29 +0000 (19:06 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Fri, 17 Jul 2009 17:06:29 +0000 (19:06 +0200)
It allows to use direct rendering if the chroma/size changes.
It also avoid *always* disabling it after a seek...
(It cost about 6% of CPU for video HD on my dual core in memcpy).

modules/codec/avcodec/video.c

index 1b888c0a01b97b6481d6f87b94c9b513db660481..2e5ab368c4c51206df5f80f9090966b5741db5ff 100644 (file)
@@ -981,21 +981,16 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
         /* We only pad picture up to 16 */
         PAD(p_sys->p_context->width,16) < i_width || PAD(p_sys->p_context->height,16) < i_height ||
         p_context->pix_fmt == PIX_FMT_PAL8 )
-    {
-        msg_Dbg( p_dec, "disabling direct rendering" );
-        p_sys->b_direct_rendering = false;
         return avcodec_default_get_buffer( p_context, p_ff_pic );
-    }
+
     p_dec->fmt_out.i_codec = p_dec->fmt_out.video.i_chroma;
 
     /* Get a new picture */
     //p_sys->p_vout->render.b_allow_modify_pics = 0;
     p_pic = ffmpeg_NewPictBuf( p_dec, p_sys->p_context );
     if( !p_pic )
-    {
-        p_sys->b_direct_rendering = false;
         return avcodec_default_get_buffer( p_context, p_ff_pic );
-    }
+
     p_sys->p_context->draw_horiz_band = NULL;
 
     p_ff_pic->opaque = (void*)p_pic;