fix for auto jitter buffer setting
This commit is contained in:
parent
36c1bc1da4
commit
5d8d6eecb2
1 changed files with 10 additions and 18 deletions
|
@ -382,19 +382,16 @@ void CClient::ProcessAudioData ( CVector<int16_t>& vecsStereoSndCrd )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// send it through the network
|
// encode current audio frame with CELT encoder
|
||||||
// Socket.SendPacket ( Channel.PrepSendPacket ( vecsNetwork ),
|
celt_encode ( CeltEncoder,
|
||||||
// Channel.GetAddress() );
|
&vecsNetwork[0],
|
||||||
|
NULL,
|
||||||
celt_encode ( CeltEncoder,
|
&vecCeltData[0],
|
||||||
&vecsNetwork[0],
|
iCeltNumCodedBytes );
|
||||||
NULL,
|
|
||||||
&vecCeltData[0],
|
|
||||||
iCeltNumCodedBytes );
|
|
||||||
|
|
||||||
Socket.SendPacket ( vecCeltData, Channel.GetAddress() );
|
|
||||||
|
|
||||||
|
|
||||||
|
// send coded audio through the network
|
||||||
|
Socket.SendPacket ( Channel.PrepSendPacket ( vecCeltData ),
|
||||||
|
Channel.GetAddress() );
|
||||||
|
|
||||||
|
|
||||||
// receive a new block
|
// receive a new block
|
||||||
|
@ -480,13 +477,8 @@ void CClient::UpdateSocketBufferSize()
|
||||||
const double dHysteresis = 0.3;
|
const double dHysteresis = 0.3;
|
||||||
|
|
||||||
// calculate current buffer setting
|
// calculate current buffer setting
|
||||||
// Use worst case scenario: We add the block size of input and
|
|
||||||
// output. This is not required if the smaller block size is a
|
|
||||||
// multiple of the bigger size, but in the general case where
|
|
||||||
// the block sizes do not have this relation, we require to have
|
|
||||||
// a minimum buffer size of the sum of both sizes
|
|
||||||
const double dAudioBufferDurationMs =
|
const double dAudioBufferDurationMs =
|
||||||
( 2 * iMonoBlockSizeSam ) * 1000 / SYSTEM_SAMPLE_RATE;
|
iMonoBlockSizeSam * 1000 / SYSTEM_SAMPLE_RATE;
|
||||||
|
|
||||||
// accumulate the standard deviations of input network stream and
|
// accumulate the standard deviations of input network stream and
|
||||||
// internal timer,
|
// internal timer,
|
||||||
|
|
Loading…
Reference in a new issue