From 399623935cf279b41baab7d3f2f69d026fc6b64a Mon Sep 17 00:00:00 2001 From: James Dong Date: Mon, 13 Dec 2010 15:24:48 -0800 Subject: [PATCH] Fix an issue where a fixed number of bits per sample is used for seek position calculation. The patch was from NV. bug - 3278233 Change-Id: I9bc22b6b0ee6bfa5d4617a8c497f67eb577efca4 --- media/libstagefright/WAVExtractor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/libstagefright/WAVExtractor.cpp b/media/libstagefright/WAVExtractor.cpp index 446021c14caab..93321209082d3 100644 --- a/media/libstagefright/WAVExtractor.cpp +++ b/media/libstagefright/WAVExtractor.cpp @@ -318,7 +318,7 @@ status_t WAVSource::read( int64_t seekTimeUs; ReadOptions::SeekMode mode; if (options != NULL && options->getSeekTo(&seekTimeUs, &mode)) { - int64_t pos = (seekTimeUs * mSampleRate) / 1000000 * mNumChannels * 2; + int64_t pos = (seekTimeUs * mSampleRate) / 1000000 * mNumChannels * (mBitsPerSample >> 3); if (pos > mSize) { pos = mSize; }