summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtneya Nair <atneya@google.com>2022-01-18 13:37:52 -0500
committerAtneya Nair <atneya@google.com>2022-02-07 20:32:55 +0000
commit4aba9d383f09d999e0f683468e19e246c0ea450f (patch)
treefe3acff5e1226afda75e5a1c11d139304182fdcd
parent37d89316169bc4c0c2a8c5a8049477cf6bac3ba9 (diff)
downloadvoip-4aba9d383f09d999e0f683468e19e246c0ea450f.tar.gz
Update AudioTrack/Record buffer interface
Test: Compiles Bug: 216175830 Change-Id: If930fd561557531d52fb1b2b0e8563515d7a69ff
-rw-r--r--src/jni/rtp/AudioGroup.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/jni/rtp/AudioGroup.cpp b/src/jni/rtp/AudioGroup.cpp
index d041c0f..7bba14d 100644
--- a/src/jni/rtp/AudioGroup.cpp
+++ b/src/jni/rtp/AudioGroup.cpp
@@ -903,8 +903,8 @@ bool AudioGroup::DeviceThread::threadLoop()
status_t status = track->obtainBuffer(&buffer, 1);
if (status == NO_ERROR) {
int offset = sampleCount - toWrite;
- memcpy(buffer.i8, &output[offset], buffer.size);
- toWrite -= buffer.frameCount;
+ memcpy(buffer.data(), &output[offset], buffer.size());
+ toWrite -= buffer.getFrameCount();
track->releaseBuffer(&buffer);
} else if (status != TIMED_OUT && status != WOULD_BLOCK) {
ALOGE("cannot write to AudioTrack");
@@ -919,8 +919,8 @@ bool AudioGroup::DeviceThread::threadLoop()
status_t status = record->obtainBuffer(&buffer, 1);
if (status == NO_ERROR) {
int offset = sampleCount - toRead;
- memcpy(&input[offset], buffer.i8, buffer.size);
- toRead -= buffer.frameCount;
+ memcpy(&input[offset], buffer.data(), buffer.size());
+ toRead -= buffer.getFrameCount();
record->releaseBuffer(&buffer);
} else if (status != TIMED_OUT && status != WOULD_BLOCK) {
ALOGE("cannot read from AudioRecord");