Commit 9d6c6d9e authored by grunell's avatar grunell Committed by Commit bot

Use valid log callback for audio modem's audio recorder.

This fixes a crash.

Also change dchecks to checks to catch early. In the unit test we use a mock stream, and there's obviously no (debug built) integration test for this.

BUG=616083
TBR=tommi@chromium.org, xiyuan@chromium.org

Review-Url: https://codereview.chromium.org/2028023002
Cr-Commit-Position: refs/heads/master@{#397127}
parent 9081ca13
...@@ -49,6 +49,8 @@ void ProcessSamples( ...@@ -49,6 +49,8 @@ void ProcessSamples(
content::BrowserThread::UI, FROM_HERE, base::Bind(callback, samples)); content::BrowserThread::UI, FROM_HERE, base::Bind(callback, samples));
} }
void OnLogMessage(const std::string& message) {}
} // namespace } // namespace
// Public methods. // Public methods.
...@@ -115,7 +117,7 @@ void AudioRecorderImpl::InitializeOnAudioThread() { ...@@ -115,7 +117,7 @@ void AudioRecorderImpl::InitializeOnAudioThread() {
? input_stream_for_testing_.get() ? input_stream_for_testing_.get()
: media::AudioManager::Get()->MakeAudioInputStream( : media::AudioManager::Get()->MakeAudioInputStream(
params, media::AudioDeviceDescription::kDefaultDeviceId, params, media::AudioDeviceDescription::kDefaultDeviceId,
media::AudioManager::LogCallback()); base::Bind(&OnLogMessage));
if (!stream_ || !stream_->Open()) { if (!stream_ || !stream_->Open()) {
LOG(ERROR) << "Failed to open an input stream."; LOG(ERROR) << "Failed to open an input stream.";
......
...@@ -63,7 +63,7 @@ AUHALStream::AUHALStream(AudioManagerMac* manager, ...@@ -63,7 +63,7 @@ AUHALStream::AUHALStream(AudioManagerMac* manager,
log_callback_(log_callback) { log_callback_(log_callback) {
// We must have a manager. // We must have a manager.
DCHECK(manager_); DCHECK(manager_);
DCHECK(!log_callback_.Equals(AudioManager::LogCallback())); CHECK(!log_callback_.Equals(AudioManager::LogCallback()));
DVLOG(1) << "ctor"; DVLOG(1) << "ctor";
DVLOG(1) << "device ID: 0x" << std::hex << device; DVLOG(1) << "device ID: 0x" << std::hex << device;
......
...@@ -270,7 +270,7 @@ AUAudioInputStream::AUAudioInputStream( ...@@ -270,7 +270,7 @@ AUAudioInputStream::AUAudioInputStream(
log_callback_(log_callback), log_callback_(log_callback),
weak_factory_(this) { weak_factory_(this) {
DCHECK(manager_); DCHECK(manager_);
DCHECK(!log_callback_.Equals(AudioManager::LogCallback())); CHECK(!log_callback_.Equals(AudioManager::LogCallback()));
// Set up the desired (output) format specified by the client. // Set up the desired (output) format specified by the client.
format_.mSampleRate = input_params.sample_rate(); format_.mSampleRate = input_params.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