diff options
author | Ricardo Garcia <rago@google.com> | 2023-09-11 19:00:30 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-09-11 19:00:30 +0000 |
commit | 1be8e5888f6273b8bbab9005127d30ec0518bc0d (patch) | |
tree | 4439b5067867f2bfe48e2fd2b596aae77dab28e4 | |
parent | 9d41c7035f0b36d665672d6bd1fff21a45c48b48 (diff) | |
parent | 09aec82f0d2c244d1c06d2180e0e469afc0403fd (diff) | |
download | sonic-1be8e5888f6273b8bbab9005127d30ec0518bc0d.tar.gz |
Upgrade sonic to 9a8d05dc0baa9159fc322dd9905a04e23b161337 am: 3780ebacad am: 09aec82f0d
Original change: https://android-review.googlesource.com/c/platform/external/sonic/+/2745925
Change-Id: I694d9ff67b91882e909da0512ae0a09bec47ba5f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-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, |