mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2024-11-10 06:31:48 +00:00
fixed .avi files starting with silence when not first in the sequence
This commit is contained in:
parent
dea818a260
commit
8adf87e7c7
3 changed files with 21 additions and 9 deletions
|
@ -12,6 +12,8 @@ chg: with r_backend GL3, depth fade with MSAA now requires GLSL 4.00 at a minimu
|
||||||
|
|
||||||
chg: with r_backend GL3, alpha to coverage now requires GLSL 4.00 at a minimum
|
chg: with r_backend GL3, alpha to coverage now requires GLSL 4.00 at a minimum
|
||||||
|
|
||||||
|
fix: /video produced .avi files that started with silence when they were not first in the sequence
|
||||||
|
|
||||||
fix: with r_backend D3D11, some device reset scenarios caused fatal errors instead of video restarts
|
fix: with r_backend D3D11, some device reset scenarios caused fatal errors instead of video restarts
|
||||||
|
|
||||||
fix: CVar slots that have been freed (e.g. through unset/cvar_trim/cvar_reset) can now be re-used
|
fix: CVar slots that have been freed (e.g. through unset/cvar_trim/cvar_reset) can now be re-used
|
||||||
|
|
|
@ -67,6 +67,12 @@ typedef struct aviFileData_s
|
||||||
byte *cBuffer, *eBuffer; // capture and encoding buffers
|
byte *cBuffer, *eBuffer; // capture and encoding buffers
|
||||||
} aviFileData_t;
|
} aviFileData_t;
|
||||||
|
|
||||||
|
typedef enum closeMode_s
|
||||||
|
{
|
||||||
|
CM_SEQUENCE_COMPLETE, // last in the sequence -> safe to clear sounds etc.
|
||||||
|
CM_SEQUENCE_INCOMPLETE // NOT last in the sequence -> we'll open a new one
|
||||||
|
} closeMode_t;
|
||||||
|
|
||||||
static aviFileData_t afd;
|
static aviFileData_t afd;
|
||||||
|
|
||||||
#define MAX_AVI_BUFFER 2048
|
#define MAX_AVI_BUFFER 2048
|
||||||
|
@ -74,6 +80,8 @@ static aviFileData_t afd;
|
||||||
static byte buffer[ MAX_AVI_BUFFER ];
|
static byte buffer[ MAX_AVI_BUFFER ];
|
||||||
static int bufIndex;
|
static int bufIndex;
|
||||||
|
|
||||||
|
static qbool CloseAVI( closeMode_t closeMode );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
===============
|
||||||
SafeFS_Write
|
SafeFS_Write
|
||||||
|
@ -334,7 +342,7 @@ qbool CL_OpenAVIForWriting( const char* fileNameNoExt, qbool reOpen )
|
||||||
static int avi_fileNameIndex;
|
static int avi_fileNameIndex;
|
||||||
|
|
||||||
if ( reOpen )
|
if ( reOpen )
|
||||||
CL_CloseAVI();
|
CloseAVI( CM_SEQUENCE_INCOMPLETE );
|
||||||
|
|
||||||
if ( afd.fileOpen )
|
if ( afd.fileOpen )
|
||||||
return qfalse;
|
return qfalse;
|
||||||
|
@ -578,7 +586,7 @@ CL_CloseAVI
|
||||||
Closes the AVI file and writes an index chunk
|
Closes the AVI file and writes an index chunk
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
qbool CL_CloseAVI( void )
|
static qbool CloseAVI( closeMode_t closeMode )
|
||||||
{
|
{
|
||||||
int indexRemainder;
|
int indexRemainder;
|
||||||
int indexSize = afd.numIndices * 16;
|
int indexSize = afd.numIndices * 16;
|
||||||
|
@ -642,11 +650,17 @@ qbool CL_CloseAVI( void )
|
||||||
|
|
||||||
Com_Printf( "Wrote %d:%d frames to %s\n", afd.numVideoFrames, afd.numAudioFrames, afd.fileName );
|
Com_Printf( "Wrote %d:%d frames to %s\n", afd.numVideoFrames, afd.numAudioFrames, afd.fileName );
|
||||||
|
|
||||||
S_StopAllSounds();
|
if ( closeMode == CM_SEQUENCE_COMPLETE )
|
||||||
|
S_StopAllSounds();
|
||||||
|
|
||||||
return qtrue;
|
return qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qbool CL_CloseAVI( void )
|
||||||
|
{
|
||||||
|
return CloseAVI( CM_SEQUENCE_COMPLETE );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
===============
|
||||||
CL_VideoRecording
|
CL_VideoRecording
|
||||||
|
|
|
@ -767,9 +767,7 @@ void CL_Disconnect( qbool showMainMenu ) {
|
||||||
FS_ClearPakReferences( FS_CGAME_REF | FS_UI_REF | FS_GENERAL_REF );
|
FS_ClearPakReferences( FS_CGAME_REF | FS_UI_REF | FS_GENERAL_REF );
|
||||||
|
|
||||||
// Stop recording any video
|
// Stop recording any video
|
||||||
if( CL_VideoRecording( ) ) {
|
CL_CloseAVI();
|
||||||
CL_CloseAVI( );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1801,9 +1799,7 @@ doesn't know what graphics to reload
|
||||||
static void CL_Vid_Restart_f()
|
static void CL_Vid_Restart_f()
|
||||||
{
|
{
|
||||||
// Settings may have changed so stop recording now
|
// Settings may have changed so stop recording now
|
||||||
if( CL_VideoRecording( ) ) {
|
CL_CloseAVI();
|
||||||
CL_CloseAVI( );
|
|
||||||
}
|
|
||||||
|
|
||||||
S_StopAllSounds(); // don't let them loop during the restart
|
S_StopAllSounds(); // don't let them loop during the restart
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue