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

Commit 21e21510 authored by Yuuki Yokoyama's avatar Yuuki Yokoyama Committed by android-build-merger
Browse files

Merge "Use default sample rate for only sw effect" am: 71a2d52f am: 4fd142e2

am: 25942ed6

Change-Id: Ibfff6dfeda67a6248f271a3c5b6394e00e33cb90
parents 68360cc2 25942ed6
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -50,6 +50,8 @@
#define ALOGVV(a...) do { } while(0)
#endif

#define DEFAULT_OUTPUT_SAMPLE_RATE 48000

namespace android {

// ----------------------------------------------------------------------------
@@ -549,7 +551,14 @@ status_t AudioFlinger::EffectModule::configure()

    mConfig.inputCfg.format = EFFECT_BUFFER_FORMAT;
    mConfig.outputCfg.format = EFFECT_BUFFER_FORMAT;

    // Don't use sample rate for thread if effect isn't offloadable.
    if ((thread->type() == ThreadBase::OFFLOAD) && !isOffloaded()) {
        mConfig.inputCfg.samplingRate = DEFAULT_OUTPUT_SAMPLE_RATE;
        ALOGV("Overriding effect input as 48kHz");
    } else {
        mConfig.inputCfg.samplingRate = thread->sampleRate();
    }
    mConfig.outputCfg.samplingRate = mConfig.inputCfg.samplingRate;
    mConfig.inputCfg.bufferProvider.cookie = NULL;
    mConfig.inputCfg.bufferProvider.getBuffer = NULL;