* 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
This commit is contained in:
Tim Angus 2007-11-18 01:06:46 +00:00
parent 3f3c827bcd
commit b62950ca6e
6 changed files with 25 additions and 22 deletions

View file

@ -889,6 +889,8 @@ void CL_Disconnect( qboolean showMainMenu ) {
// Stop recording any video
if( CL_VideoRecording( ) ) {
// Finish rendering current frame
SCR_UpdateScreen( );
CL_CloseAVI( );
}
CL_UpdateGUID( NULL, 0 );

View file

@ -226,8 +226,9 @@ snd_stream_t *S_CodecUtilOpen(const char *filename, snd_codec_t *codec)
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;
}

View file

@ -77,7 +77,7 @@ int S_CodecReadStream(snd_stream_t *stream, int bytes, void *buffer);
// 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;

View file

@ -251,7 +251,7 @@ snd_stream_t *S_OGG_CodecOpenStream(const char *filename)
vf = Z_Malloc(sizeof(OggVorbis_File));
if(!vf)
{
S_CodecUtilClose(stream);
S_CodecUtilClose(&stream);
return NULL;
}
@ -261,7 +261,7 @@ snd_stream_t *S_OGG_CodecOpenStream(const char *filename)
{
Z_Free(vf);
S_CodecUtilClose(stream);
S_CodecUtilClose(&stream);
return NULL;
}
@ -273,7 +273,7 @@ snd_stream_t *S_OGG_CodecOpenStream(const char *filename)
Z_Free(vf);
S_CodecUtilClose(stream);
S_CodecUtilClose(&stream);
return NULL;
}
@ -285,7 +285,7 @@ snd_stream_t *S_OGG_CodecOpenStream(const char *filename)
Z_Free(vf);
S_CodecUtilClose(stream);
S_CodecUtilClose(&stream);
return NULL;
}
@ -298,7 +298,7 @@ snd_stream_t *S_OGG_CodecOpenStream(const char *filename)
Z_Free(vf);
S_CodecUtilClose(stream);
S_CodecUtilClose(&stream);
return NULL;
}
@ -343,7 +343,7 @@ void S_OGG_CodecCloseStream(snd_stream_t *stream)
Z_Free(stream->ptr);
// close the stream
S_CodecUtilClose(stream);
S_CodecUtilClose(&stream);
}
/*

View file

@ -255,7 +255,7 @@ snd_stream_t *S_WAV_CodecOpenStream(const char *filename)
// Read the RIFF header
if(!S_ReadRIFFHeader(rv->file, &rv->info))
{
S_CodecUtilClose(rv);
S_CodecUtilClose(&rv);
return NULL;
}
@ -269,7 +269,7 @@ S_WAV_CodecCloseStream
*/
void S_WAV_CodecCloseStream(snd_stream_t *stream)
{
S_CodecUtilClose(stream);
S_CodecUtilClose(&stream);
}
/*