Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 612cf86e authored by Jon Larimer's avatar Jon Larimer Committed by Android Git Automerger
Browse files

am a2c49ff4: am afa0e369: am cad46fbd: am f1a93e47: Merge "SoftOpus: Fix...

am a2c49ff4: am afa0e369: am cad46fbd: am f1a93e47: Merge "SoftOpus: Fix output buffer capacity." into lmp-dev

* commit 'a2c49ff4':
  SoftOpus: Fix output buffer capacity.
parents 90be27c6 a2c49ff4
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -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;