diff options
author | Marco Nelissen <marcone@google.com> | 2015-02-06 12:21:32 -0800 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2015-02-06 21:05:54 +0000 |
commit | 41d3f579d2c166984958263533284209b90c87d5 (patch) | |
tree | 40b9ed5f373b6515ef828a19cd55fcf2ac1ddef6 /media/libstagefright/WAVExtractor.cpp | |
parent | 35395ea6ad11824a4a89cc1ab9ee84f936188296 (diff) | |
download | frameworks_av-41d3f579d2c166984958263533284209b90c87d5.zip frameworks_av-41d3f579d2c166984958263533284209b90c87d5.tar.gz frameworks_av-41d3f579d2c166984958263533284209b90c87d5.tar.bz2 |
Fix GSM WAV playback
Bug:19289381
Change-Id: If7bbf1ecf1cb8796188e61bc2c42f8a099510424
Diffstat (limited to 'media/libstagefright/WAVExtractor.cpp')
-rw-r--r-- | media/libstagefright/WAVExtractor.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/media/libstagefright/WAVExtractor.cpp b/media/libstagefright/WAVExtractor.cpp index a4a651d..335ac84 100644 --- a/media/libstagefright/WAVExtractor.cpp +++ b/media/libstagefright/WAVExtractor.cpp @@ -439,10 +439,6 @@ status_t WAVSource::read( maxBytesToRead = maxBytesAvailable; } - // read only integral amounts of audio unit frames. - const size_t inputUnitFrameSize = mNumChannels * mBitsPerSample / 8; - maxBytesToRead -= maxBytesToRead % inputUnitFrameSize; - if (mWaveFormat == WAVE_FORMAT_MSGSM) { // Microsoft packs 2 frames into 65 bytes, rather than using separate 33-byte frames, // so read multiples of 65, and use smaller buffers to account for ~10:1 expansion ratio @@ -450,6 +446,10 @@ status_t WAVSource::read( maxBytesToRead = 1024; } maxBytesToRead = (maxBytesToRead / 65) * 65; + } else { + // read only integral amounts of audio unit frames. + const size_t inputUnitFrameSize = mNumChannels * mBitsPerSample / 8; + maxBytesToRead -= maxBytesToRead % inputUnitFrameSize; } ssize_t n = mDataSource->readAt( |