OSDN Git Service

Noise will be heard if audio sample rate not matched with audio track
authorMing Zhou <b42586@freescale.com>
Wed, 27 Feb 2013 09:12:37 +0000 (17:12 +0800)
committerguoyin.chen <guoyin.chen@freescale.com>
Fri, 7 Jun 2013 06:04:44 +0000 (14:04 +0800)
When audio sample rate which set to audio track is not the same with
the actual pcm data, noise will be heard. Fix the bug when write 8 bit
pcm samples.

Change-Id: Idcb0d7b0e9aaa250dd22b758c8337e23d1706049
Signed-off-by: Ming Zhou <b42586@freescale.com>
Signed-off-by: guoyin.chen <guoyin.chen@freescale.com>
media/libmedia/AudioTrack.cpp

index aec8c4a..3278dbe 100644 (file)
@@ -1121,8 +1121,8 @@ ssize_t AudioTrack::write(const void* buffer, size_t userSize)
         } else {
             toWrite = audioBuffer.size;
             memcpy(audioBuffer.i8, src, toWrite);
-            src += toWrite;
         }
+        src += toWrite;
         userSize -= toWrite;
         written += toWrite;