diff options
author | Marco Nelissen <marcone@google.com> | 2015-02-09 04:14:02 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-02-09 04:14:02 +0000 |
commit | 2308d92b43fa97f25f27818b0dcfda3af7447f55 (patch) | |
tree | 6cac91b14c2c691ced739745edb68b95d6fc042a /media | |
parent | 2d869b268c971fc11b9cc61298163740be43f300 (diff) | |
parent | a23eea5d6160e2ebddb925f20becfc3c52639243 (diff) | |
download | frameworks_av-2308d92b43fa97f25f27818b0dcfda3af7447f55.zip frameworks_av-2308d92b43fa97f25f27818b0dcfda3af7447f55.tar.gz frameworks_av-2308d92b43fa97f25f27818b0dcfda3af7447f55.tar.bz2 |
am a23eea5d: am 5dc38beb: am 41d3f579: Fix GSM WAV playback
* commit 'a23eea5d6160e2ebddb925f20becfc3c52639243':
Fix GSM WAV playback
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 17 | ||||
-rw-r--r-- | media/libstagefright/WAVExtractor.cpp | 8 |
2 files changed, 21 insertions, 4 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 3751175..c8806ae 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -3803,6 +3803,23 @@ status_t ACodec::getPortFormat(OMX_U32 portIndex, sp<AMessage> ¬ify) { break; } + case OMX_AUDIO_CodingGSMFR: + { + OMX_AUDIO_PARAM_MP3TYPE params; + InitOMXParams(¶ms); + params.nPortIndex = portIndex; + + CHECK_EQ(mOMX->getParameter( + mNode, OMX_IndexParamAudioPcm, + ¶ms, sizeof(params)), + (status_t)OK); + + notify->setString("mime", MEDIA_MIMETYPE_AUDIO_MSGSM); + notify->setInt32("channel-count", params.nChannels); + notify->setInt32("sample-rate", params.nSampleRate); + break; + } + default: ALOGE("UNKNOWN AUDIO CODING: %d\n", audioDef->eEncoding); TRESPASS(); 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( |