p_vout->p_sys->p_display = NULL;
p_vout->p_sys->p_overlay = NULL;
+ p_vout->p_sys->b_must_acquire = 0;
/* Initialize library */
if( SDL_Init(SDL_INIT_VIDEO) < 0 )
return( 1 );
}
- if( SDLOpenDisplay(p_vout) )
- {
- intf_ErrMsg( "error: can't initialize SDL library: %s\n",
- SDL_GetError() );
- free( p_vout->p_sys );
- 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 */
if(psz_display != NULL && strcmp(psz_display,"fullscreen")==0)
{
p_vout->p_sys->b_fullscreen = 1;
- } else {
+ }
+ else
+ {
p_vout->p_sys->b_fullscreen = 0;
}
+
p_vout->p_sys->b_reopen_display = 1;
+ if( SDLOpenDisplay(p_vout) )
+ {
+ intf_ErrMsg( "error: can't initialize SDL library: %s\n",
+ SDL_GetError() );
+ free( p_vout->p_sys );
+ return( 1 );
+ }
+
return( 0 );
-}
+ }
/*****************************************************************************
* vout_SDLInit: initialize SDL video thread output method
if( SDLOpenDisplay(p_vout) )
{
- intf_ErrMsg( "error: can't open DISPLAY default display\n" );
- return( 1 );
+ intf_ErrMsg( "error: can't open DISPLAY default display\n" );
+ return( 1 );
}
p_vout->p_sys->b_reopen_display = 0;
}
p_vout->p_sys->p_display = SDL_SetVideoMode(p_vout->i_width,
p_vout->i_height,
0,
- SDL_ANYFORMAT | SDL_HWSURFACE | SDL_DOUBLEBUF );
+ SDL_ANYFORMAT | SDL_HWSURFACE | SDL_DOUBLEBUF );
SDL_ShowCursor( 1 );
}
intf_ErrMsg( "error: can't open DISPLAY default display\n" );
return( 1 );
}
- p_vout->p_sys->p_overlay = NULL;
+ SDL_LockSurface(p_vout->p_sys->p_display);
SDL_WM_SetCaption( VOUT_TITLE , VOUT_TITLE );
SDL_EventState(SDL_KEYUP , SDL_IGNORE); /* ignore keys up */
/* Check buffers properties */
p_vout->p_sys->b_must_acquire = 1; /* always acquire */
- p_vout->p_sys->p_buffer[ 0 ] =
- p_vout->p_sys->p_display->pixels;
-
- SDL_Flip(p_vout->p_sys->p_display);
- p_vout->p_sys->p_buffer[ 1 ] =
- p_vout->p_sys->p_display->pixels;
- SDL_Flip(p_vout->p_sys->p_display);
+ p_vout->p_sys->p_buffer[ 0 ] =
+ p_vout->p_sys->p_display->pixels;
+
+ SDL_Flip(p_vout->p_sys->p_display);
+ p_vout->p_sys->p_buffer[ 1 ] =
+ p_vout->p_sys->p_display->pixels;
+ SDL_Flip(p_vout->p_sys->p_display);
/* Set graphic context colors */
/*
- col_fg.r = col_fg.g = col_fg.b = -1;
+ col_fg.r = col_fg.g = col_fg.b = -1;
col_bg.r = col_bg.g = col_bg.b = 0;
if( ggiSetGCForeground(p_vout->p_sys->p_display,
ggiMapColor(p_vout->p_sys->p_display,&col_fg)) ||
p_vout->i_height = p_vout->p_sys->p_display->h;
p_vout->i_bytes_per_line = p_vout->p_sys->p_display->format->BytesPerPixel *
- p_vout->p_sys->p_display->w ;
+ p_vout->p_sys->p_display->w ;
p_vout->i_screen_depth = p_vout->p_sys->p_display->format->BitsPerPixel;
p_vout->i_bytes_per_pixel = p_vout->p_sys->p_display->format->BytesPerPixel;