diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-09-21 22:05:20 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-09-21 22:05:20 +0000 |
commit | b232d27ea426fd61d8411d39d0d78fb2a140d4fa (patch) | |
tree | 4439b5067867f2bfe48e2fd2b596aae77dab28e4 | |
parent | e75659944f45582b7f0c44852872872945016e9b (diff) | |
parent | c887eec662308859b91600b8eb3f7acaa0cb48ba (diff) | |
download | sonic-b232d27ea426fd61d8411d39d0d78fb2a140d4fa.tar.gz |
Snap for 10843824 from c887eec662308859b91600b8eb3f7acaa0cb48ba to 24Q1-release
Change-Id: I4d4248ab4fde722062f71c57062d67ef932b9883
-rw-r--r-- | METADATA | 10 | ||||
-rw-r--r-- | sonic.c | 13 |
2 files changed, 10 insertions, 13 deletions
@@ -1,19 +1,19 @@ # This project was upgraded with external_updater. # Usage: tools/external_updater/updater.sh update sonic -# For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md +# For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md name: "sonic" description: "Sonic is a simple algorithm for speeding up or slowing down speech." third_party { url { type: ARCHIVE - value: "https://github.com/waywardgeek/sonic/archive/0555641f2d7e52a3d1720b4ae5affb5d50bdde23.zip" + value: "https://github.com/waywardgeek/sonic/archive/9a8d05dc0baa9159fc322dd9905a04e23b161337.zip" } - version: "0555641f2d7e52a3d1720b4ae5affb5d50bdde23" + version: "9a8d05dc0baa9159fc322dd9905a04e23b161337" license_type: NOTICE last_upgrade_date { year: 2023 - month: 5 - day: 3 + month: 9 + day: 9 } } @@ -391,7 +391,7 @@ static int allocateStreamBuffers(sonicStream stream, int sampleRate, /* Allocate 25% more than needed so we hopefully won't grow. */ stream->pitchBufferSize = maxRequired + (maxRequired >> 2); stream->pitchBuffer = - (short*)sonicCalloc(maxRequired, sizeof(short) * numChannels); + (short*)sonicCalloc(stream->pitchBufferSize, sizeof(short) * numChannels); if (stream->pitchBuffer == NULL) { sonicDestroyStream(stream); return 0; @@ -887,15 +887,12 @@ static int moveNewSamplesToPitchBuffer(sonicStream stream, int originalNumOutputSamples) { int numSamples = stream->numOutputSamples - originalNumOutputSamples; int numChannels = stream->numChannels; + int pitchBufferSize = stream->pitchBufferSize; - if (stream->numPitchSamples + numSamples > stream->pitchBufferSize) { - int pitchBufferSize = stream->pitchBufferSize; + if (stream->numPitchSamples + numSamples > pitchBufferSize) { stream->pitchBufferSize += (pitchBufferSize >> 1) + numSamples; - stream->pitchBuffer = (short*)sonicRealloc( - stream->pitchBuffer, - pitchBufferSize, - stream->pitchBufferSize, - sizeof(short) * numChannels); + stream->pitchBuffer = (short*)sonicRealloc(stream->pitchBuffer, + pitchBufferSize, stream->pitchBufferSize, sizeof(short) * numChannels); } memcpy(stream->pitchBuffer + stream->numPitchSamples * numChannels, stream->outputBuffer + originalNumOutputSamples * numChannels, |