[xiph-cvs] cvs commit: theora/examples player_example.c

Monty xiphmont at xiph.org
Tue Sep 24 20:22:32 PDT 2002



xiphmont    02/09/24 23:22:31

  Modified:    examples player_example.c
  Log:
  Don't let SDL clobber the SIGINT handler until we're in a place to
  catch it with a new handler.

Revision  Changes    Path
1.6       +4 -5      theora/examples/player_example.c

Index: player_example.c
===================================================================
RCS file: /usr/local/cvsroot/theora/examples/player_example.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- player_example.c	25 Sep 2002 03:07:46 -0000	1.5
+++ player_example.c	25 Sep 2002 03:22:31 -0000	1.6
@@ -12,7 +12,7 @@
 
   function: example SDL player application; plays Ogg Theora files (with
             optional Vorbis audio second stream)
-  last mod: $Id: player_example.c,v 1.5 2002/09/25 03:07:46 xiphmont Exp $
+  last mod: $Id: player_example.c,v 1.6 2002/09/25 03:22:31 xiphmont Exp $
 
  ********************************************************************/
 
@@ -275,6 +275,10 @@
 }
 
 static void open_video(void){
+  if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+    fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
+    exit(1);
+  }
   
   screen = SDL_SetVideoMode(ti.width, ti.height, 0, SDL_SWSURFACE);
   if ( screen == NULL ) {
@@ -343,11 +347,6 @@
   
   int i,j;
   ogg_packet op;
-
-  if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
-    fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
-    exit(1);
-  }
 
 #ifdef _WIN32 /* We need to set stdin/stdout to binary mode. Damn windows. */
   /* Beware the evil ifdef. We avoid these where we can, but this one we 

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list