From a6fe4de420e5a7ecaf3c02039893d7166adba380 Mon Sep 17 00:00:00 2001 From: Christophe Massiot Date: Mon, 19 Feb 2001 19:28:33 +0000 Subject: [PATCH] * Kludge of the kludge, removing an oddity in YUV initialisation, and activating YUV overlay on startup whenever hardware acceleration is available. Thanks for bearing with us, stay tuned. --- plugins/sdl/vout_sdl.c | 19 +++++++++++++------ src/video_output/video_output.c | 11 ++++------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/plugins/sdl/vout_sdl.c b/plugins/sdl/vout_sdl.c index 4096b813e7..a8bac09361 100644 --- a/plugins/sdl/vout_sdl.c +++ b/plugins/sdl/vout_sdl.c @@ -154,12 +154,6 @@ static int vout_Create( vout_thread_t *p_vout ) return( 1 ); } - /* Force the software yuv even if it is not used */ - /* If we don't do this, p_vout is not correctly initialized - and it's impossible to switch between soft/hard yuv */ - /* FIXME: this is a broken way to do !! fix this !! */ - p_vout->b_need_render = 1; - p_vout->p_sys->b_cursor = 1; /* TODO should be done with a main_GetInt.. */ p_vout->p_sys->b_fullscreen = main_GetIntVariable( VOUT_FULLSCREEN_VAR, VOUT_FULLSCREEN_DEFAULT ); @@ -216,6 +210,19 @@ static int vout_Create( vout_thread_t *p_vout ) *****************************************************************************/ static int vout_Init( vout_thread_t *p_vout ) { + /* This hack is hugly, but hey, you are, too. */ + + SDL_Overlay * p_overlay; + + p_overlay = SDL_CreateYUVOverlay( VOUT_WIDTH_DEFAULT, VOUT_HEIGHT_DEFAULT, + SDL_YV12_OVERLAY, + p_vout->p_sys->p_display ); + intf_Msg( "vout: YUV acceleration %s", + p_overlay->hw_overlay ? "activated" : "unavailable !" ); + p_vout->b_need_render = !p_overlay->hw_overlay; + + SDL_FreeYUVOverlay( p_overlay ); + return( 0 ); } diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c index b008eb7e54..f0bad5a037 100644 --- a/src/video_output/video_output.c +++ b/src/video_output/video_output.c @@ -930,14 +930,11 @@ static int InitThread( vout_thread_t *p_vout ) return( 1 ); } - if( p_vout->b_need_render ) + /* Initialize convertion tables and functions */ + if( vout_InitYUV( p_vout ) ) { - /* Initialize convertion tables and functions */ - if( vout_InitYUV( p_vout ) ) - { - intf_ErrMsg("vout error: can't allocate YUV translation tables"); - return( 1 ); - } + intf_ErrMsg("vout error: can't allocate YUV translation tables"); + return( 1 ); } /* Mark thread as running and return */ -- 2.39.2