ACM: Corrected temporary buffer size
This CL corrects the temporary buffers size in the pre-processing of the capture audio before encoding. As part of this it removes the ACM-specific hardcoding of the size and instead ensures that the size of the temporary buffer matches that of the AudioFrame. Bug: webrtc:11242 Change-Id: I56dd6cadfd4e140e8e159966c33d1027383ea9fa Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170340 Commit-Queue: Per Åhgren <peah@webrtc.org> Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org> Reviewed-by: Henrik Andreassson <henrika@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30775}
This commit is contained in:
@ -24,6 +24,12 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace {
|
||||
// Buffer size for stereo 48 kHz audio.
|
||||
constexpr size_t kWebRtc10MsPcmAudio = 960;
|
||||
|
||||
} // namespace
|
||||
|
||||
TestPacketization::TestPacketization(RTPStream* rtpStream, uint16_t frequency)
|
||||
: _rtpStream(rtpStream), _frequency(frequency), _seqNo(0) {}
|
||||
|
||||
@ -92,7 +98,7 @@ void Sender::Run() {
|
||||
}
|
||||
|
||||
Receiver::Receiver()
|
||||
: _playoutLengthSmpls(WEBRTC_10MS_PCM_AUDIO),
|
||||
: _playoutLengthSmpls(kWebRtc10MsPcmAudio),
|
||||
_payloadSizeBytes(MAX_INCOMING_PAYLOAD) {}
|
||||
|
||||
void Receiver::Setup(AudioCodingModule* acm,
|
||||
@ -139,7 +145,7 @@ void Receiver::Setup(AudioCodingModule* acm,
|
||||
_pcmFile.Open(file_name, 32000, "wb+");
|
||||
|
||||
_realPayloadSizeBytes = 0;
|
||||
_playoutBuffer = new int16_t[WEBRTC_10MS_PCM_AUDIO];
|
||||
_playoutBuffer = new int16_t[kWebRtc10MsPcmAudio];
|
||||
_frequency = playSampFreq;
|
||||
_acm = acm;
|
||||
_firstTime = true;
|
||||
|
Reference in New Issue
Block a user