mirror of
https://github.com/w23/xash3d-fwgs
synced 2024-12-16 14:10:11 +01:00
engine: client: voice: fixed hanging voice status
This commit is contained in:
parent
2f5f5ef0a6
commit
74707551ae
@ -1503,6 +1503,7 @@ void CL_Disconnect( void )
|
||||
cls.connect_time = 0;
|
||||
cls.changedemo = false;
|
||||
cls.max_fragment_size = FRAGMENT_MAX_SIZE; // reset fragment size
|
||||
Voice_Disconnect();
|
||||
CL_Stop_f();
|
||||
|
||||
// send a disconnect message to the server
|
||||
@ -1514,7 +1515,6 @@ void CL_Disconnect( void )
|
||||
|
||||
// clear the network channel, too.
|
||||
Netchan_Clear( &cls.netchan );
|
||||
Voice_RecordStop();
|
||||
|
||||
IN_LockInputDevices( false ); // unlock input devices
|
||||
|
||||
|
@ -323,6 +323,16 @@ void Voice_RecordStart( void )
|
||||
Voice_Status( -1, true );
|
||||
}
|
||||
|
||||
void Voice_Disconnect( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
Voice_RecordStop();
|
||||
for( i = 0; i <= 32; i++ ) {
|
||||
Voice_Status( i, false );
|
||||
}
|
||||
}
|
||||
|
||||
void Voice_AddIncomingData( int ent, const byte *data, uint size, uint frames )
|
||||
{
|
||||
int samples = opus_decode( voice.decoder, data, size, (short *)voice.decompress_buffer, voice.frame_size / voice.width * frames, false );
|
||||
@ -380,6 +390,5 @@ void Voice_PlayerTalkingAck(int playerIndex)
|
||||
void Voice_StartChannel( uint samples, byte *data, int entnum )
|
||||
{
|
||||
SND_ForceInitMouth( entnum );
|
||||
Voice_Status( entnum, true );
|
||||
S_RawEntSamples( entnum, samples, voice.samplerate, voice.width, voice.channels, data, 255 );
|
||||
}
|
||||
|
@ -77,6 +77,7 @@ void Voice_Idle( float frametime );
|
||||
qboolean Voice_IsRecording( void );
|
||||
void Voice_RecordStop( void );
|
||||
void Voice_RecordStart( void );
|
||||
void Voice_Disconnect( void );
|
||||
void Voice_AddIncomingData( int ent, const byte *data, uint size, uint frames );
|
||||
qboolean Voice_GetLoopback( void );
|
||||
void Voice_LocalPlayerTalkingAck( void );
|
||||
|
Loading…
Reference in New Issue
Block a user