summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMisael Lopez Cruz <misael.lopez@ti.com>2014-01-30 15:27:20 -0600
committerMisael Lopez Cruz <misael.lopez@ti.com>2014-01-30 17:05:50 -0600
commit00fb8c8511b0a94dddd90b357abcc45be1b00a36 (patch)
treef318b3aaadb9d8cad50b54a25c2d569e5edc03b9
parent7c835cd660854083860e2ee8793ab6b5dff84c21 (diff)
downloadcommon-open-00fb8c8511b0a94dddd90b357abcc45be1b00a36.tar.gz
audio: utils: Fix SimpleWriter's returned frames
SimpleWriter must return the number of SimpleOutStream's frames written. The returned number of frames was that of the underlying PcmOutPort which differs from the SimpleOutStream's when resampling is used (due to the resampling ratio). Change-Id: Iecbb13f4a8f9be0fc84ae60b408437b946de6d6e Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
-rw-r--r--audio/utils/src/SimpleStream.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/audio/utils/src/SimpleStream.cpp b/audio/utils/src/SimpleStream.cpp
index 5038e59..446eb84 100644
--- a/audio/utils/src/SimpleStream.cpp
+++ b/audio/utils/src/SimpleStream.cpp
@@ -614,10 +614,12 @@ int SimpleWriter::write(const void *buffer, size_t frames)
}
ret = mPort->write(outBuffer, outFrames);
- if (ret < 0)
+ if (ret < 0) {
ALOGE("SimpleWriter: failed to write PCM data %d", ret);
+ return ret;
+ }
- return ret;
+ return frames;
}
} /* namespace tiaudioutils */