[Cleanup] Remove write-only member _sndCardRecDelay.
The code was doing nothing except for triggering thread sanitizer, since concurrent writes weren't guarded: * ReadRecordedData() through webrtc_audio_module_rec_thread * InitPlayout() through main thread Bug: webrtc:9751 Change-Id: I7ecf4fa436ff0695e5b998d7e3f159fb6c7e9214 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146216 Reviewed-by: Henrik Andreassson <henrika@webrtc.org> Commit-Queue: Yves Gerey <yvesg@google.com> Cr-Commit-Position: refs/heads/master@{#28636}
This commit is contained in:
parent
b93a2451e0
commit
432fe68af8
@ -50,7 +50,6 @@ AudioDeviceLinuxPulse::AudioDeviceLinuxPulse()
|
||||
update_speaker_volume_at_startup_(false),
|
||||
quit_(false),
|
||||
_sndCardPlayDelay(0),
|
||||
_sndCardRecDelay(0),
|
||||
_writeErrors(0),
|
||||
_deviceIndex(-1),
|
||||
_numPlayDevices(0),
|
||||
@ -944,7 +943,6 @@ int32_t AudioDeviceLinuxPulse::InitPlayout() {
|
||||
// Mark playout side as initialized
|
||||
_playIsInitialized = true;
|
||||
_sndCardPlayDelay = 0;
|
||||
_sndCardRecDelay = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1214,7 +1212,6 @@ int32_t AudioDeviceLinuxPulse::StopPlayout() {
|
||||
_playIsInitialized = false;
|
||||
_playing = false;
|
||||
_sndCardPlayDelay = 0;
|
||||
_sndCardRecDelay = 0;
|
||||
|
||||
RTC_LOG(LS_VERBOSE) << "stopping playback";
|
||||
|
||||
@ -1891,8 +1888,6 @@ int32_t AudioDeviceLinuxPulse::ReadRecordedData(const void* bufferData,
|
||||
(uint32_t)((LatencyUsecs(_recStream) / 1000) +
|
||||
10 * ((size + _recordBufferUsed) / _recordBufferSize));
|
||||
|
||||
_sndCardRecDelay = recDelay;
|
||||
|
||||
if (_playStream) {
|
||||
// Get the playout delay.
|
||||
_sndCardPlayDelay = (uint32_t)(LatencyUsecs(_playStream) / 1000);
|
||||
@ -2257,8 +2252,6 @@ bool AudioDeviceLinuxPulse::RecThreadProcess() {
|
||||
break;
|
||||
}
|
||||
|
||||
_sndCardRecDelay = (uint32_t)(LatencyUsecs(_recStream) / 1000);
|
||||
|
||||
// Drop lock for sigslot dispatch, which could take a while.
|
||||
PaUnLock();
|
||||
// Read data and provide it to VoiceEngine
|
||||
|
||||
@ -299,7 +299,6 @@ class AudioDeviceLinuxPulse : public AudioDeviceGeneric {
|
||||
bool quit_ RTC_GUARDED_BY(&_critSect);
|
||||
|
||||
uint32_t _sndCardPlayDelay;
|
||||
uint32_t _sndCardRecDelay;
|
||||
|
||||
int32_t _writeErrors;
|
||||
|
||||
|
||||
@ -413,7 +413,6 @@ AudioDeviceWindowsCore::AudioDeviceWindowsCore()
|
||||
_playBlockSize(0),
|
||||
_playChannels(2),
|
||||
_sndCardPlayDelay(0),
|
||||
_sndCardRecDelay(0),
|
||||
_writtenSamples(0),
|
||||
_readSamples(0),
|
||||
_recAudioFrameSize(0),
|
||||
@ -2471,9 +2470,6 @@ int32_t AudioDeviceWindowsCore::StopRecording() {
|
||||
}
|
||||
}
|
||||
|
||||
// Reset the recording delay value.
|
||||
_sndCardRecDelay = 0;
|
||||
|
||||
_UnLock();
|
||||
|
||||
return err;
|
||||
@ -3287,8 +3283,6 @@ DWORD AudioDeviceWindowsCore::DoCaptureThread() {
|
||||
(10 * syncBufIndex) / _recBlockSize - 10);
|
||||
uint32_t sndCardPlayDelay = static_cast<uint32_t>(_sndCardPlayDelay);
|
||||
|
||||
_sndCardRecDelay = sndCardRecDelay;
|
||||
|
||||
while (syncBufIndex >= _recBlockSize) {
|
||||
if (_ptrAudioBuffer) {
|
||||
_ptrAudioBuffer->SetRecordedBuffer((const int8_t*)syncBuffer,
|
||||
|
||||
@ -281,7 +281,6 @@ class AudioDeviceWindowsCore : public AudioDeviceGeneric {
|
||||
uint32_t _devicePlayBlockSize;
|
||||
uint32_t _playChannels;
|
||||
uint32_t _sndCardPlayDelay;
|
||||
uint32_t _sndCardRecDelay;
|
||||
UINT64 _writtenSamples;
|
||||
UINT64 _readSamples;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user