changeset 1080:36b883428aeb

init checks return value of sdl_open
author al3x
date Sat, 09 Jun 2001 18:42:36 +0000
parents 1e0da351feaa
children 48cd2c5a9542
files libvo/vo_sdl.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_sdl.c	Sat Jun 09 18:02:06 2001 +0000
+++ b/libvo/vo_sdl.c	Sat Jun 09 18:42:36 2001 +0000
@@ -355,12 +355,12 @@
 
 	/* initialize the SDL Video system */
 	if (SDL_Init (SDL_INIT_VIDEO/*|SDL_INIT_NOPARACHUTE*/)) {
-		if(verbose > 2) printf("SDL: Initializing of SDL failed: %s.\n", SDL_GetError());
+		printf("SDL: Initializing of SDL failed: %s.\n", SDL_GetError());
 		return -1;
 	}
 	
 	SDL_VideoDriverName(priv->driver, 8);
-	if(verbose) printf("SDL: Using driver: %s\n", priv->driver);
+	printf("SDL: Using driver: %s\n", priv->driver);
 	/* other default values */
 	#ifdef SDL_NOHWSURFACE
 		if(verbose) printf("SDL: using software-surface\n");
@@ -595,6 +595,7 @@
 init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format)
 //static int sdl_setup (int width, int height)
 {
+	int ret;
 	struct sdl_priv_s *priv = &sdl_priv;
         unsigned int sdl_format;
 	SDL_Rect res;
@@ -670,7 +671,8 @@
 		XCloseDisplay(XDisplay);
 	}
 #endif
-	sdl_open (NULL, NULL);
+	if (sdl_open(NULL, NULL) != 0)
+	    return -1;
 
 	/* Set output window title */
 	SDL_WM_SetCaption (".: MPlayer : F = Fullscreen/Windowed : C = Cycle Fullscreen Resolutions :.", "SDL Video Out");