summaryrefslogtreecommitdiff
path: root/src/client/cl_avi.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2009-10-03 11:12:39 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:14:44 +0000
commit593953c7deabb08cc77c22c08f5c8859bafbcb79 (patch)
tree8a22c17d66e749656a5665e1379d29ca715e219e /src/client/cl_avi.c
parent3ffe4805cfebd93a60bf59b582303540b2ec0d80 (diff)
* Merge ioq3-r1233
Diffstat (limited to 'src/client/cl_avi.c')
-rw-r--r--src/client/cl_avi.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/client/cl_avi.c b/src/client/cl_avi.c
index c54e7054..df7bc7b9 100644
--- a/src/client/cl_avi.c
+++ b/src/client/cl_avi.c
@@ -250,14 +250,17 @@ void CL_WriteAVIHeader( void )
WRITE_2BYTES( 1 ); //biPlanes
WRITE_2BYTES( 24 ); //biBitCount
- if( afd.motionJpeg ) { //biCompression
+ if( afd.motionJpeg ) //biCompression
+ {
WRITE_STRING( "MJPG" );
WRITE_4BYTES( afd.width *
- afd.height ); //biSizeImage
- } else {
+ afd.height ); //biSizeImage
+ }
+ else
+ {
WRITE_4BYTES( 0 ); // BI_RGB
WRITE_4BYTES( afd.width *
- afd.height*3 ); //biSizeImage
+ afd.height * 3 ); //biSizeImage
}
WRITE_4BYTES( 0 ); //biXPelsPetMeter
@@ -391,10 +394,14 @@ qboolean CL_OpenAVIForWriting( const char *fileName )
}
else if( Q_stricmp( Cvar_VariableString( "s_backend" ), "OpenAL" ) )
{
- if( afd.a.bits == 16 && afd.a.channels == 2 )
- afd.audio = qtrue;
+ if( afd.a.bits != 16 || afd.a.channels != 2 )
+ {
+ Com_Printf( S_COLOR_YELLOW "WARNING: Audio format of %d bit/%d channels not supported",
+ afd.a.bits, afd.a.channels );
+ afd.audio = qfalse;
+ }
else
- afd.audio = qfalse; //FIXME: audio not implemented for this case
+ afd.audio = qtrue;
}
else
{
@@ -542,7 +549,7 @@ void CL_WriteAVIAudioFrame( const byte *pcmBuffer, int size )
WRITE_4BYTES( bytesInBuffer );
SafeFS_Write( buffer, 8, afd.f );
- SafeFS_Write( pcmBuffer, bytesInBuffer, afd.f );
+ SafeFS_Write( pcmCaptureBuffer, bytesInBuffer, afd.f );
SafeFS_Write( padding, paddingSize, afd.f );
afd.fileSize += ( chunkSize + paddingSize );