diff options
author | ksorim <ksorim@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-03-21 14:08:40 +0000 |
---|---|---|
committer | ksorim <ksorim@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-03-21 14:08:40 +0000 |
commit | 3b4870d90a5db11189e024e6d75d62f5766b86a0 (patch) | |
tree | 0c20d15ce5e62e45395a60f8ef04bbbe5ac0deec /libvo/vo_sdl.c | |
parent | 8d16eb3c4e54b23082abd3e56a124fec667b4105 (diff) | |
download | mpv-3b4870d90a5db11189e024e6d75d62f5766b86a0.tar.bz2 mpv-3b4870d90a5db11189e024e6d75d62f5766b86a0.tar.xz |
This will hopefully fix
* uninit call without a previous config call
* Several config calls between preinit and uninit
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5241 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_sdl.c')
-rw-r--r-- | libvo/vo_sdl.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/libvo/vo_sdl.c b/libvo/vo_sdl.c index 3dd872bf42..b1379d9efe 100644 --- a/libvo/vo_sdl.c +++ b/libvo/vo_sdl.c @@ -450,19 +450,18 @@ static int sdl_open (void *plugin, void *name) /* default to no fullscreen mode, we'll set this as soon we have the avail. modes */ - priv->fullmode = -2; - - priv->surface = NULL; - priv->rgbsurface = NULL; - priv->overlay = NULL; - priv->fullmodes = NULL; + priv->fullmode = -2; + + priv->fullmodes = NULL; priv->bpp = 0; /* initialize the SDL Video system */ - if (SDL_Init (SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE)) { - printf("SDL: Initializing of SDL failed: %s.\n", SDL_GetError()); - return -1; - } + if (!SDL_WasInit(SDL_INIT_VIDEO)) { + if (SDL_Init (SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE)) { + printf("SDL: Initializing of SDL failed: %s.\n", SDL_GetError()); + return -1; + } + } SDL_VideoDriverName(priv->driver, 8); printf("SDL: Using driver: %s\n", priv->driver); @@ -521,9 +520,12 @@ static int sdl_open (void *plugin, void *name) priv->bpp = vidInfo->vfmt->BitsPerPixel; if (priv->mode == YUV && priv->bpp < 16) { - if(verbose) printf("SDL: Your SDL display target wants to be at a color depth of (%d), but we need it to be at\ -least 16 bits, so we need to emulate 16-bit color. This is going to slow things down; you might want to\ -increase your display's color depth, if possible.\n", priv->bpp); + if(verbose) printf("SDL: Your SDL display target wants to be at a color " + "depth of (%d), but we need it to be at least 16 " + "bits, so we need to emulate 16-bit color. This is " + "going to slow things down; you might want to " + "increase your display's color depth, if possible.\n", + priv->bpp); priv->bpp = 16; } @@ -571,10 +573,8 @@ static int sdl_close (void) /* DONT attempt to free the fullscreen modes array. SDL_Quit* does this for us */ /* Cleanup SDL */ - //SDL_Quit(); - SDL_QuitSubSystem(SDL_INIT_VIDEO); - /* might have to be changed to quitsubsystem only, if plugins become - * changeable on the fly */ + if(SDL_WasInit(SDL_INIT_VIDEO)) + SDL_QuitSubSystem(SDL_INIT_VIDEO); if(verbose > 2) printf("SDL: Closed Plugin\n"); @@ -812,10 +812,6 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin priv->dstwidth = d_width ? d_width : width; priv->dstheight = d_height ? d_height : height; - priv->rgbsurface = NULL; - priv->overlay = NULL; - priv->surface = NULL; - priv->format = format; #ifdef HAVE_X11 @@ -1616,7 +1612,13 @@ uninit(void) static uint32_t preinit(const char *arg) { - return 0; + struct sdl_priv_s *priv = &sdl_priv; + + priv->rgbsurface = NULL; + priv->overlay = NULL; + priv->surface = NULL; + + return 0; } static uint32_t get_image(mp_image_t *mpi) |