1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-17 21:27:08 +00:00

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
This commit is contained in:
ksorim 2002-03-21 14:08:40 +00:00
parent 8d16eb3c4e
commit 3b4870d90a

View File

@ -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 */ /* default to no fullscreen mode, we'll set this as soon we have the avail. modes */
priv->fullmode = -2; priv->fullmode = -2;
priv->surface = NULL; priv->fullmodes = NULL;
priv->rgbsurface = NULL;
priv->overlay = NULL;
priv->fullmodes = NULL;
priv->bpp = 0; priv->bpp = 0;
/* initialize the SDL Video system */ /* initialize the SDL Video system */
if (SDL_Init (SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE)) { if (!SDL_WasInit(SDL_INIT_VIDEO)) {
printf("SDL: Initializing of SDL failed: %s.\n", SDL_GetError()); if (SDL_Init (SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE)) {
return -1; printf("SDL: Initializing of SDL failed: %s.\n", SDL_GetError());
} return -1;
}
}
SDL_VideoDriverName(priv->driver, 8); SDL_VideoDriverName(priv->driver, 8);
printf("SDL: Using driver: %s\n", priv->driver); 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; priv->bpp = vidInfo->vfmt->BitsPerPixel;
if (priv->mode == YUV && priv->bpp < 16) { 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\ if(verbose) printf("SDL: Your SDL display target wants to be at a color "
least 16 bits, so we need to emulate 16-bit color. This is going to slow things down; you might want to\ "depth of (%d), but we need it to be at least 16 "
increase your display's color depth, if possible.\n", priv->bpp); "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; 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 */ /* DONT attempt to free the fullscreen modes array. SDL_Quit* does this for us */
/* Cleanup SDL */ /* Cleanup SDL */
//SDL_Quit(); if(SDL_WasInit(SDL_INIT_VIDEO))
SDL_QuitSubSystem(SDL_INIT_VIDEO); SDL_QuitSubSystem(SDL_INIT_VIDEO);
/* might have to be changed to quitsubsystem only, if plugins become
* changeable on the fly */
if(verbose > 2) printf("SDL: Closed Plugin\n"); 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->dstwidth = d_width ? d_width : width;
priv->dstheight = d_height ? d_height : height; priv->dstheight = d_height ? d_height : height;
priv->rgbsurface = NULL;
priv->overlay = NULL;
priv->surface = NULL;
priv->format = format; priv->format = format;
#ifdef HAVE_X11 #ifdef HAVE_X11
@ -1616,7 +1612,13 @@ uninit(void)
static uint32_t preinit(const char *arg) 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) static uint32_t get_image(mp_image_t *mpi)