mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-11-23 02:15:55 +01:00
engine: client: voice: fix crackling voice file input on low FPS
This commit is contained in:
parent
1a09d297ee
commit
305b2579eb
@ -159,9 +159,11 @@ static uint Voice_GetOpusCompressedData( byte *out, uint maxsize, uint *frames )
|
||||
if( voice.input_file )
|
||||
{
|
||||
uint numbytes;
|
||||
double updateInterval;
|
||||
double updateInterval, curtime = Sys_DoubleTime();
|
||||
|
||||
updateInterval = curtime - voice.start_time;
|
||||
voice.start_time = curtime;
|
||||
|
||||
updateInterval = cl.mtime[0] - cl.mtime[1];
|
||||
numbytes = updateInterval * voice.samplerate * voice.width * VOICE_PCM_CHANNELS;
|
||||
numbytes = Q_min( numbytes, voice.input_file->size - voice.input_file_pos );
|
||||
numbytes = Q_min( numbytes, sizeof( voice.input_buffer ) - voice.input_buffer_pos );
|
||||
|
Loading…
Reference in New Issue
Block a user