diff options
author | Andreas Huber <andih@google.com> | 2012-03-16 12:00:18 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2012-03-16 12:00:18 -0700 |
commit | ad3e7e223309ba1c1b485d722517bc1be10e27c0 (patch) | |
tree | e5f24ad886c8585c3e2b2a21b11b86280bc884d3 /media/libstagefright/codecs | |
parent | ddc421d19c797096de77c24f68a37ad23216e2a7 (diff) | |
download | frameworks_base-ad3e7e223309ba1c1b485d722517bc1be10e27c0.zip frameworks_base-ad3e7e223309ba1c1b485d722517bc1be10e27c0.tar.gz frameworks_base-ad3e7e223309ba1c1b485d722517bc1be10e27c0.tar.bz2 |
ACodec is a little more aggressive in its error checking now.
Update components to do the right thing.
Change-Id: Ibfbad3f53effc16368cca4a0e978d01d54d08a1d
Diffstat (limited to 'media/libstagefright/codecs')
-rw-r--r-- | media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp | 12 | ||||
-rw-r--r-- | media/libstagefright/codecs/g711/dec/SoftG711.cpp | 6 |
2 files changed, 16 insertions, 2 deletions
diff --git a/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp b/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp index 7602f2d..796caa4 100644 --- a/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp +++ b/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp @@ -236,6 +236,18 @@ OMX_ERRORTYPE SoftAMR::internalSetParameter( return OMX_ErrorNone; } + case OMX_IndexParamAudioPcm: + { + const OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams = + (OMX_AUDIO_PARAM_PCMMODETYPE *)params; + + if (pcmParams->nPortIndex != 1) { + return OMX_ErrorUndefined; + } + + return OMX_ErrorNone; + } + default: return SimpleSoftOMXComponent::internalSetParameter(index, params); } diff --git a/media/libstagefright/codecs/g711/dec/SoftG711.cpp b/media/libstagefright/codecs/g711/dec/SoftG711.cpp index 32ef003..bcdd3c7 100644 --- a/media/libstagefright/codecs/g711/dec/SoftG711.cpp +++ b/media/libstagefright/codecs/g711/dec/SoftG711.cpp @@ -140,7 +140,7 @@ OMX_ERRORTYPE SoftG711::internalSetParameter( OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams = (OMX_AUDIO_PARAM_PCMMODETYPE *)params; - if (pcmParams->nPortIndex != 0) { + if (pcmParams->nPortIndex != 0 && pcmParams->nPortIndex != 1) { return OMX_ErrorUndefined; } @@ -148,7 +148,9 @@ OMX_ERRORTYPE SoftG711::internalSetParameter( return OMX_ErrorUndefined; } - mNumChannels = pcmParams->nChannels; + if(pcmParams->nPortIndex == 0) { + mNumChannels = pcmParams->nChannels; + } return OMX_ErrorNone; } |