r1214 - in trunk/code: client sys

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Nov 17 20:06:46 EST 2007


Author: tma
Date: 2007-11-17 20:06:46 -0500 (Sat, 17 Nov 2007)
New Revision: 1214

Modified:
   trunk/code/client/cl_main.c
   trunk/code/client/snd_codec.c
   trunk/code/client/snd_codec.h
   trunk/code/client/snd_codec_ogg.c
   trunk/code/client/snd_codec_wav.c
   trunk/code/sys/sys_main.c
Log:
* Fix bug where an extraneous render command can cause a crash when
  recording video
* Make S_CodecUtilClose NULL the snd_stream_t pointer
* Fix indentation in runtime SDL check code


Modified: trunk/code/client/cl_main.c
===================================================================
--- trunk/code/client/cl_main.c	2007-11-16 22:41:01 UTC (rev 1213)
+++ trunk/code/client/cl_main.c	2007-11-18 01:06:46 UTC (rev 1214)
@@ -889,6 +889,8 @@
 
 	// Stop recording any video
 	if( CL_VideoRecording( ) ) {
+		// Finish rendering current frame
+		SCR_UpdateScreen( );
 		CL_CloseAVI( );
 	}
 	CL_UpdateGUID( NULL, 0 );

Modified: trunk/code/client/snd_codec.c
===================================================================
--- trunk/code/client/snd_codec.c	2007-11-16 22:41:01 UTC (rev 1213)
+++ trunk/code/client/snd_codec.c	2007-11-18 01:06:46 UTC (rev 1214)
@@ -226,8 +226,9 @@
 S_CodecUtilClose
 =================
 */
-void S_CodecUtilClose(snd_stream_t *stream)
+void S_CodecUtilClose(snd_stream_t **stream)
 {
-	FS_FCloseFile(stream->file);
-	Z_Free(stream);
+	FS_FCloseFile((*stream)->file);
+	Z_Free(*stream);
+	*stream = NULL;
 }

Modified: trunk/code/client/snd_codec.h
===================================================================
--- trunk/code/client/snd_codec.h	2007-11-16 22:41:01 UTC (rev 1213)
+++ trunk/code/client/snd_codec.h	2007-11-18 01:06:46 UTC (rev 1214)
@@ -77,7 +77,7 @@
 
 // Util functions (used by codecs)
 snd_stream_t *S_CodecUtilOpen(const char *filename, snd_codec_t *codec);
-void S_CodecUtilClose(snd_stream_t *stream);
+void S_CodecUtilClose(snd_stream_t **stream);
 
 // WAV Codec
 extern snd_codec_t wav_codec;

Modified: trunk/code/client/snd_codec_ogg.c
===================================================================
--- trunk/code/client/snd_codec_ogg.c	2007-11-16 22:41:01 UTC (rev 1213)
+++ trunk/code/client/snd_codec_ogg.c	2007-11-18 01:06:46 UTC (rev 1214)
@@ -251,7 +251,7 @@
 	vf = Z_Malloc(sizeof(OggVorbis_File));
 	if(!vf)
 	{
-		S_CodecUtilClose(stream);
+		S_CodecUtilClose(&stream);
 
 		return NULL;
 	}
@@ -261,7 +261,7 @@
 	{
 		Z_Free(vf);
 
-		S_CodecUtilClose(stream);
+		S_CodecUtilClose(&stream);
 
 		return NULL;
 	}
@@ -273,7 +273,7 @@
 
 		Z_Free(vf);
 
-		S_CodecUtilClose(stream);
+		S_CodecUtilClose(&stream);
 
 		return NULL;
 	}
@@ -285,7 +285,7 @@
 
 		Z_Free(vf);
 
-		S_CodecUtilClose(stream);
+		S_CodecUtilClose(&stream);
 
 		return NULL;  
 	}
@@ -298,7 +298,7 @@
 
 		Z_Free(vf);
 
-		S_CodecUtilClose(stream);
+		S_CodecUtilClose(&stream);
 
 		return NULL;  
 	}
@@ -343,7 +343,7 @@
 	Z_Free(stream->ptr);
 
 	// close the stream
-	S_CodecUtilClose(stream);
+	S_CodecUtilClose(&stream);
 }
 
 /*

Modified: trunk/code/client/snd_codec_wav.c
===================================================================
--- trunk/code/client/snd_codec_wav.c	2007-11-16 22:41:01 UTC (rev 1213)
+++ trunk/code/client/snd_codec_wav.c	2007-11-18 01:06:46 UTC (rev 1214)
@@ -255,7 +255,7 @@
 	// Read the RIFF header
 	if(!S_ReadRIFFHeader(rv->file, &rv->info))
 	{
-		S_CodecUtilClose(rv);
+		S_CodecUtilClose(&rv);
 		return NULL;
 	}
 
@@ -269,7 +269,7 @@
 */
 void S_WAV_CodecCloseStream(snd_stream_t *stream)
 {
-	S_CodecUtilClose(stream);
+	S_CodecUtilClose(&stream);
 }
 
 /*

Modified: trunk/code/sys/sys_main.c
===================================================================
--- trunk/code/sys/sys_main.c	2007-11-16 22:41:01 UTC (rev 1213)
+++ trunk/code/sys/sys_main.c	2007-11-18 01:06:46 UTC (rev 1214)
@@ -587,21 +587,21 @@
 	char  commandLine[ MAX_STRING_CHARS ] = { 0 };
 
 #ifndef DEDICATED
-  const SDL_version *ver = SDL_Linked_Version( );
+	const SDL_version *ver = SDL_Linked_Version( );
 
 #define STRING(s) #s
 #define XSTRING(s) STRING(s)
 #define MINSDL_VERSION \
-  XSTRING(MINSDL_MAJOR) "." \
-  XSTRING(MINSDL_MINOR) "." \
-  XSTRING(MINSDL_PATCH)
+	XSTRING(MINSDL_MAJOR) "." \
+	XSTRING(MINSDL_MINOR) "." \
+	XSTRING(MINSDL_PATCH)
 
-  if( SDL_VERSIONNUM( ver->major, ver->minor, ver->patch ) <
-      SDL_VERSIONNUM( MINSDL_MAJOR, MINSDL_MINOR, MINSDL_PATCH ) )
-  {
-    Sys_Print( "SDL version " MINSDL_VERSION " or greater required\n" );
-    Sys_Exit( 1 );
-  }
+	if( SDL_VERSIONNUM( ver->major, ver->minor, ver->patch ) <
+			SDL_VERSIONNUM( MINSDL_MAJOR, MINSDL_MINOR, MINSDL_PATCH ) )
+	{
+		Sys_Print( "SDL version " MINSDL_VERSION " or greater required\n" );
+		Sys_Exit( 1 );
+	}
 #endif
 
 	Sys_ParseArgs( argc, argv );




More information about the quake3-commits mailing list