summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Larimer <jlarimer@google.com>2015-08-18 14:45:26 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-18 14:45:26 +0000
commitcad46fbde4961d5374c27f9d85cd8f2b6822ffa7 (patch)
tree642e2b86313c7dad841e00b6f7186ee45f7a4b0d
parent8369ac13ad207baebbaf4cd7b357a35dd54408c6 (diff)
parentf1a93e4720a71c308c3d88a9f751555ff532a01c (diff)
downloadframeworks_av-cad46fbde4961d5374c27f9d85cd8f2b6822ffa7.zip
frameworks_av-cad46fbde4961d5374c27f9d85cd8f2b6822ffa7.tar.gz
frameworks_av-cad46fbde4961d5374c27f9d85cd8f2b6822ffa7.tar.bz2
am f1a93e47: Merge "SoftOpus: Fix output buffer capacity." into lmp-dev
* commit 'f1a93e4720a71c308c3d88a9f751555ff532a01c': SoftOpus: Fix output buffer capacity.
-rw-r--r--media/libstagefright/codecs/opus/dec/SoftOpus.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/media/libstagefright/codecs/opus/dec/SoftOpus.cpp b/media/libstagefright/codecs/opus/dec/SoftOpus.cpp
index b8084ae..ed52a37 100644
--- a/media/libstagefright/codecs/opus/dec/SoftOpus.cpp
+++ b/media/libstagefright/codecs/opus/dec/SoftOpus.cpp
@@ -34,6 +34,12 @@ namespace android {
static const int kRate = 48000;
+// Opus uses Vorbis channel mapping, and Vorbis channel mapping specifies
+// mappings for up to 8 channels. This information is part of the Vorbis I
+// Specification:
+// http://www.xiph.org/vorbis/doc/Vorbis_I_spec.html
+static const int kMaxChannels = 8;
+
template<class T>
static void InitOMXParams(T *params) {
params->nSize = sizeof(T);
@@ -101,7 +107,7 @@ void SoftOpus::initPorts() {
def.eDir = OMX_DirOutput;
def.nBufferCountMin = kNumBuffers;
def.nBufferCountActual = def.nBufferCountMin;
- def.nBufferSize = kMaxNumSamplesPerBuffer * sizeof(int16_t);
+ def.nBufferSize = kMaxNumSamplesPerBuffer * sizeof(int16_t) * kMaxChannels;
def.bEnabled = OMX_TRUE;
def.bPopulated = OMX_FALSE;
def.eDomain = OMX_PortDomainAudio;
@@ -225,12 +231,6 @@ static uint16_t ReadLE16(const uint8_t *data, size_t data_size,
return val;
}
-// Opus uses Vorbis channel mapping, and Vorbis channel mapping specifies
-// mappings for up to 8 channels. This information is part of the Vorbis I
-// Specification:
-// http://www.xiph.org/vorbis/doc/Vorbis_I_spec.html
-static const int kMaxChannels = 8;
-
// Maximum packet size used in Xiph's opusdec.
static const int kMaxOpusOutputPacketSizeSamples = 960 * 6;