summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMisael Lopez Cruz2014-01-30 15:27:20 -0600
committerMisael Lopez Cruz2014-01-30 17:05:50 -0600
commit00fb8c8511b0a94dddd90b357abcc45be1b00a36 (patch)
treef318b3aaadb9d8cad50b54a25c2d569e5edc03b9
parent7c835cd660854083860e2ee8793ab6b5dff84c21 (diff)
downloaddevice-ti-common-open-00fb8c8511b0a94dddd90b357abcc45be1b00a36.tar.gz
device-ti-common-open-00fb8c8511b0a94dddd90b357abcc45be1b00a36.tar.xz
device-ti-common-open-00fb8c8511b0a94dddd90b357abcc45be1b00a36.zip
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)
614 } 614 }
615 615
616 ret = mPort->write(outBuffer, outFrames); 616 ret = mPort->write(outBuffer, outFrames);
617 if (ret < 0) 617 if (ret < 0) {
618 ALOGE("SimpleWriter: failed to write PCM data %d", ret); 618 ALOGE("SimpleWriter: failed to write PCM data %d", ret);
619 return ret;
620 }
619 621
620 return ret; 622 return frames;
621} 623}
622 624
623} /* namespace tiaudioutils */ 625} /* namespace tiaudioutils */