uninit bugs fixed

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5159 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-03-17 03:38:16 +00:00
parent 8a77bc1aec
commit f19ef5a1ff
1 changed files with 8 additions and 7 deletions

View File

@ -185,6 +185,8 @@ static void flip_page(void){
vo_mga_flip_page(); vo_mga_flip_page();
} }
static int inited=0;
static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t* info) static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t* info)
{ {
char * frame_mem; char * frame_mem;
@ -266,6 +268,8 @@ static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width, uint3
default: printf( "Sorry, this (%d) color depth not supported.\n",vo_depthonscreen ); return -1; default: printf( "Sorry, this (%d) color depth not supported.\n",vo_depthonscreen ); return -1;
} }
inited=1;
aspect(&d_width,&d_height,A_NOZOOM); aspect(&d_width,&d_height,A_NOZOOM);
#ifdef HAVE_NEW_GUI #ifdef HAVE_NEW_GUI
if ( vo_window == None ) if ( vo_window == None )
@ -349,14 +353,11 @@ static const vo_info_t* get_info( void )
static void static void
uninit(void) uninit(void)
{ {
saver_on(mDisplay); if(!inited) return;
#ifdef HAVE_NEW_GUI inited=0;
if ( vo_window == None )
#endif
{
XDestroyWindow( mDisplay,vo_window );
}
mga_uninit(); mga_uninit();
saver_on(mDisplay);
vo_x11_uninit(mDisplay, vo_window);
printf("vo: uninit!\n"); printf("vo: uninit!\n");
} }