Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: webrtc/modules/audio_device/android/audio_record_jni.cc

Issue 1373443003: Modifies invalid DCHECK in AudioRecordJni::OnCacheDirectBufferAddress() (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: nit Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 if (!j_audio_record_->StopRecording()) { 168 if (!j_audio_record_->StopRecording()) {
169 ALOGE("StopRecording failed!"); 169 ALOGE("StopRecording failed!");
170 return -1; 170 return -1;
171 } 171 }
172 // If we don't detach here, we will hit a RTC_DCHECK in OnDataIsRecorded() 172 // If we don't detach here, we will hit a RTC_DCHECK in OnDataIsRecorded()
173 // next time StartRecording() is called since it will create a new Java 173 // next time StartRecording() is called since it will create a new Java
174 // thread. 174 // thread.
175 thread_checker_java_.DetachFromThread(); 175 thread_checker_java_.DetachFromThread();
176 initialized_ = false; 176 initialized_ = false;
177 recording_ = false; 177 recording_ = false;
178 direct_buffer_address_= nullptr;
178 return 0; 179 return 0;
179 } 180 }
180 181
181 void AudioRecordJni::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) { 182 void AudioRecordJni::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) {
182 ALOGD("AttachAudioBuffer"); 183 ALOGD("AttachAudioBuffer");
183 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 184 RTC_DCHECK(thread_checker_.CalledOnValidThread());
184 audio_device_buffer_ = audioBuffer; 185 audio_device_buffer_ = audioBuffer;
185 const int sample_rate_hz = audio_parameters_.sample_rate(); 186 const int sample_rate_hz = audio_parameters_.sample_rate();
186 ALOGD("SetRecordingSampleRate(%d)", sample_rate_hz); 187 ALOGD("SetRecordingSampleRate(%d)", sample_rate_hz);
187 audio_device_buffer_->SetRecordingSampleRate(sample_rate_hz); 188 audio_device_buffer_->SetRecordingSampleRate(sample_rate_hz);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 // of |playDelayMs| and |recDelayMs|, hence the distributions does not matter. 254 // of |playDelayMs| and |recDelayMs|, hence the distributions does not matter.
254 audio_device_buffer_->SetVQEData(total_delay_in_milliseconds_, 255 audio_device_buffer_->SetVQEData(total_delay_in_milliseconds_,
255 0, // recDelayMs 256 0, // recDelayMs
256 0); // clockDrift 257 0); // clockDrift
257 if (audio_device_buffer_->DeliverRecordedData() == -1) { 258 if (audio_device_buffer_->DeliverRecordedData() == -1) {
258 ALOGE("AudioDeviceBuffer::DeliverRecordedData failed!"); 259 ALOGE("AudioDeviceBuffer::DeliverRecordedData failed!");
259 } 260 }
260 } 261 }
261 262
262 } // namespace webrtc 263 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_device/android/audio_device_unittest.cc ('k') | webrtc/modules/audio_device/android/audio_track_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698