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

Commit 37fefc82 authored by Mikhail Naganov's avatar Mikhail Naganov Committed by Gerrit Code Review
Browse files

Merge "AIDL Bundle Effects : Add missing initialisation of samples per second." into main

parents b1dff394 514c8636
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -32,6 +32,20 @@ using ::aidl::android::media::audio::common::AudioChannelLayout;
using ::aidl::android::media::audio::common::AudioDeviceDescription;
using ::aidl::android::media::audio::common::AudioDeviceType;

BundleContext::BundleContext(int statusDepth, const Parameter::Common& common,
              const lvm::BundleEffectType& type)
        : EffectContext(statusDepth, common), mType(type) {
    LOG(DEBUG) << __func__ << type;
    int channelCount = ::aidl::android::hardware::audio::common::getChannelCount(
            common.input.base.channelMask);
    mSamplesPerSecond = common.input.base.sampleRate * channelCount;
}

BundleContext::~BundleContext() {
    LOG(DEBUG) << __func__;
    deInit();
}

RetCode BundleContext::init() {
    std::lock_guard lg(mMutex);
    // init with pre-defined preset NORMAL
+2 −8
Original line number Diff line number Diff line
@@ -29,14 +29,8 @@ namespace aidl::android::hardware::audio::effect {
class BundleContext final : public EffectContext {
  public:
    BundleContext(int statusDepth, const Parameter::Common& common,
                  const lvm::BundleEffectType& type)
        : EffectContext(statusDepth, common), mType(type) {
        LOG(DEBUG) << __func__ << type;
    }
    ~BundleContext() override {
        LOG(DEBUG) << __func__;
        deInit();
    }
                  const lvm::BundleEffectType& type);
    ~BundleContext();

    RetCode init();
    void deInit();