summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Gloria Wang <gwang@google.com> 2011-07-24 12:07:20 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2011-07-24 12:07:20 -0700
commit508e86e7577fabf528afe06ecc098f8e677ff48c (patch)
treef7a49d4d7f6501efee29b30219e1a6e71594db9d
parent895de9269fa125bf3903c21faf5e8d2750bfb000 (diff)
parent75cfd5b87994a3c44cd4ad07a85a7fabf51f669a (diff)
Merge "Do not change the number of bytes while converting 8-bit samples to 16-bit, because this number will be used later to calculate mCurrentPos. Fix for bug 5063703."
-rw-r--r--media/libstagefright/WAVExtractor.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/media/libstagefright/WAVExtractor.cpp b/media/libstagefright/WAVExtractor.cpp
index bf978d789dc5..c406964bd96d 100644
--- a/media/libstagefright/WAVExtractor.cpp
+++ b/media/libstagefright/WAVExtractor.cpp
@@ -370,7 +370,9 @@ status_t WAVSource::read(
int16_t *dst = (int16_t *)tmp->data();
const uint8_t *src = (const uint8_t *)buffer->data();
- while (n-- > 0) {
+ ssize_t numBytes = n;
+
+ while (numBytes-- > 0) {
*dst++ = ((int16_t)(*src) - 128) * 256;
++src;
}