Loading media/libaudioprocessing/AudioMixerBase.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -453,9 +453,9 @@ void AudioMixerBase::setParameter(int name, int target, int param, void *value) &track->mVolume[param - VOLUME0], &track->mPrevVolume[param - VOLUME0], &track->mVolumeInc[param - VOLUME0])) { ALOGV("setParameter(%s, VOLUME%d: %04x)", ALOGV("setParameter(%s, VOLUME%d: %f)", target == VOLUME ? "VOLUME" : "RAMP_VOLUME", param - VOLUME0, track->volume[param - VOLUME0]); track->mVolume[param - VOLUME0]); invalidate(); } } else { Loading Loading @@ -630,7 +630,7 @@ void AudioMixerBase::process__validate() if (t->volumeInc[0]|t->volumeInc[1]) { volumeRamp = true; } else if (!t->doesResample() && t->volumeRL == 0) { } else if (!t->doesResample() && t->isVolumeMuted()) { n |= NEEDS_MUTE; } t->needs = n; Loading Loading @@ -730,7 +730,7 @@ void AudioMixerBase::process__validate() for (const int name : mEnabled) { const std::shared_ptr<TrackBase> &t = mTracks[name]; if (!t->doesResample() && t->volumeRL == 0) { if (!t->doesResample() && t->isVolumeMuted()) { t->needs |= NEEDS_MUTE; t->hook = &TrackBase::track__nop; } else { Loading media/libaudioprocessing/include/media/AudioMixerBase.h +10 −0 Original line number Diff line number Diff line Loading @@ -290,6 +290,16 @@ public: audio_channel_mask_t mMixerChannelMask; uint32_t mMixerChannelCount; // consider volume muted only if all channel volume (floating point) is 0.f inline bool isVolumeMuted() const { for (const auto volume : mVolume) { if (volume != 0) { return false; } } return true; } protected: // hooks Loading Loading
media/libaudioprocessing/AudioMixerBase.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -453,9 +453,9 @@ void AudioMixerBase::setParameter(int name, int target, int param, void *value) &track->mVolume[param - VOLUME0], &track->mPrevVolume[param - VOLUME0], &track->mVolumeInc[param - VOLUME0])) { ALOGV("setParameter(%s, VOLUME%d: %04x)", ALOGV("setParameter(%s, VOLUME%d: %f)", target == VOLUME ? "VOLUME" : "RAMP_VOLUME", param - VOLUME0, track->volume[param - VOLUME0]); track->mVolume[param - VOLUME0]); invalidate(); } } else { Loading Loading @@ -630,7 +630,7 @@ void AudioMixerBase::process__validate() if (t->volumeInc[0]|t->volumeInc[1]) { volumeRamp = true; } else if (!t->doesResample() && t->volumeRL == 0) { } else if (!t->doesResample() && t->isVolumeMuted()) { n |= NEEDS_MUTE; } t->needs = n; Loading Loading @@ -730,7 +730,7 @@ void AudioMixerBase::process__validate() for (const int name : mEnabled) { const std::shared_ptr<TrackBase> &t = mTracks[name]; if (!t->doesResample() && t->volumeRL == 0) { if (!t->doesResample() && t->isVolumeMuted()) { t->needs |= NEEDS_MUTE; t->hook = &TrackBase::track__nop; } else { Loading
media/libaudioprocessing/include/media/AudioMixerBase.h +10 −0 Original line number Diff line number Diff line Loading @@ -290,6 +290,16 @@ public: audio_channel_mask_t mMixerChannelMask; uint32_t mMixerChannelCount; // consider volume muted only if all channel volume (floating point) is 0.f inline bool isVolumeMuted() const { for (const auto volume : mVolume) { if (volume != 0) { return false; } } return true; } protected: // hooks Loading