From 84333e0475bc911adc16417f4ca327c975cf6c36 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Fri, 7 Feb 2014 15:36:10 -0800 Subject: warnings be gone. Change-Id: Ie3bae3f037730e316d7fca12e7a3527973f752ef --- media/libstagefright/WAVExtractor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'media/libstagefright/WAVExtractor.cpp') diff --git a/media/libstagefright/WAVExtractor.cpp b/media/libstagefright/WAVExtractor.cpp index 22af6fb..fe9058b 100644 --- a/media/libstagefright/WAVExtractor.cpp +++ b/media/libstagefright/WAVExtractor.cpp @@ -127,7 +127,7 @@ sp WAVExtractor::getTrack(size_t index) { } sp WAVExtractor::getTrackMetaData( - size_t index, uint32_t flags) { + size_t index, uint32_t /* flags */) { if (mInitCheck != OK || index > 0) { return NULL; } @@ -358,7 +358,7 @@ WAVSource::~WAVSource() { } } -status_t WAVSource::start(MetaData *params) { +status_t WAVSource::start(MetaData * /* params */) { ALOGV("WAVSource::start"); CHECK(!mStarted); -- cgit v1.1 From a5750e0dad9e90f2195ce36f2c4457fa04b2b83e Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Wed, 18 Jun 2014 16:34:45 -0700 Subject: libstagefright: 64-bit compile warnings Change-Id: I3d1146714fa23be3d4e696599b6f70cac1f9d28b --- media/libstagefright/WAVExtractor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'media/libstagefright/WAVExtractor.cpp') diff --git a/media/libstagefright/WAVExtractor.cpp b/media/libstagefright/WAVExtractor.cpp index fe9058b..7124fd3 100644 --- a/media/libstagefright/WAVExtractor.cpp +++ b/media/libstagefright/WAVExtractor.cpp @@ -414,7 +414,7 @@ status_t WAVSource::read( } else { pos = (seekTimeUs * mSampleRate) / 1000000 * mNumChannels * (mBitsPerSample >> 3); } - if (pos > mSize) { + if (pos > (off64_t)mSize) { pos = mSize; } mCurrentPos = pos + mOffset; -- cgit v1.1 From e3fdb6012905d593c9350958f4429d0d670adae4 Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Fri, 8 Aug 2014 15:52:38 -0700 Subject: Fix WAVExtractor to output full audio frames only Fixes NuPlayer crash from MediaBuffers ending in partial audio frames. Bug: 16881623 Change-Id: Ia80a9910f99245e645860c00ae85118cc85bef57 --- media/libstagefright/WAVExtractor.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'media/libstagefright/WAVExtractor.cpp') diff --git a/media/libstagefright/WAVExtractor.cpp b/media/libstagefright/WAVExtractor.cpp index 7124fd3..a4a651d 100644 --- a/media/libstagefright/WAVExtractor.cpp +++ b/media/libstagefright/WAVExtractor.cpp @@ -439,6 +439,10 @@ 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 -- cgit v1.1