Commit 21e1836c authored by Ken MacKay's avatar Ken MacKay Committed by Commit Bot

[Chromecast] Fix small mixer bugs

 * Make it so the old command-line arg to set a fixed output sample rate
   works.
 * Avoid NaN in postprocessor volume calculation.

Bug: internal b/74089224
Change-Id: Ic9534d16e8eff5e24faf3cac8b41e8aa63c3397a
Reviewed-on: https://chromium-review.googlesource.com/960966Reviewed-by: default avatarStephen Lanham <slan@chromium.org>
Commit-Queue: Kenneth MacKay <kmackay@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542975}
parent e081b91a
......@@ -192,7 +192,7 @@ void PostProcessingPipelineImpl::UpdateCastVolume(float multiplier) {
return;
}
current_multiplier_ = multiplier;
current_dbfs_ = std::log10(multiplier) * 20;
current_dbfs_ = (multiplier == 0.0f ? -200.0f : std::log10(multiplier) * 20);
DCHECK(chromecast::media::VolumeControl::DbFSToVolume);
cast_volume_ = chromecast::media::VolumeControl::DbFSToVolume(current_dbfs_);
}
......
......@@ -86,13 +86,11 @@ int GetFixedSampleRate() {
int fixed_sample_rate = GetSwitchValueNonNegativeInt(
switches::kAudioOutputSampleRate, MixerOutputStream::kInvalidSampleRate);
#if defined(USE_ALSA)
if (fixed_sample_rate == MixerOutputStream::kInvalidSampleRate) {
fixed_sample_rate =
GetSwitchValueNonNegativeInt(switches::kAlsaFixedOutputSampleRate,
MixerOutputStream::kInvalidSampleRate);
}
#endif // defined(USE_ALSA)
return fixed_sample_rate;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment