summaryrefslogtreecommitdiffstats
path: root/media/audio
diff options
context:
space:
mode:
authorxians@chromium.org <xians@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-21 14:37:23 +0000
committerxians@chromium.org <xians@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-21 14:37:23 +0000
commit4fb94e03d8167b15df33c401f66042e99ee1ea25 (patch)
treeeaa4141d1ac2a2bf2fdf662fea839bfb94c4c866 /media/audio
parent9de0dfbabe44560c7de51a30894716dc08c46642 (diff)
downloadchromium_src-4fb94e03d8167b15df33c401f66042e99ee1ea25.zip
chromium_src-4fb94e03d8167b15df33c401f66042e99ee1ea25.tar.gz
chromium_src-4fb94e03d8167b15df33c401f66042e99ee1ea25.tar.bz2
Don't query the stream latency when setting up the input stream.
The code querying the stream latency can cause crash, this has been verified on the output side and resolved by removing the code. See cl: https://chromiumcodereview.appspot.com/9310004/ So we are doing the same things on input. Test=None Bug=109959 Review URL: http://codereview.chromium.org/9395008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122822 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio')
-rw-r--r--media/audio/mac/audio_low_latency_input_mac.cc33
-rw-r--r--media/audio/mac/audio_low_latency_input_mac.h4
-rw-r--r--media/audio/mac/audio_low_latency_output_mac.h4
3 files changed, 5 insertions, 36 deletions
diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc
index ec97fe9..36858ac 100644
--- a/media/audio/mac/audio_low_latency_input_mac.cc
+++ b/media/audio/mac/audio_low_latency_input_mac.cc
@@ -388,39 +388,8 @@ double AUAudioInputStream::GetHardwareLatency() {
&device_latency_frames);
DLOG_IF(WARNING, result != noErr) << "Could not get audio device latency.";
- // Get the stream latency.
- property_address.mSelector = kAudioDevicePropertyStreams;
- UInt32 stream_latency_frames = 0;
- size = 0;
- result = AudioObjectGetPropertyDataSize(input_device_id_,
- &property_address,
- 0,
- NULL,
- &size);
- if (!result) {
- scoped_ptr_malloc<AudioStreamID>
- streams(reinterpret_cast<AudioStreamID*>(malloc(size)));
- AudioStreamID* stream_ids = streams.get();
- result = AudioObjectGetPropertyData(input_device_id_,
- &property_address,
- 0,
- NULL,
- &size,
- stream_ids);
- if (!result) {
- property_address.mSelector = kAudioStreamPropertyLatency;
- result = AudioObjectGetPropertyData(stream_ids[0],
- &property_address,
- 0,
- NULL,
- &size,
- &stream_latency_frames);
- }
- }
- DLOG_IF(WARNING, result != noErr) << "Could not get audio stream latency.";
-
return static_cast<double>((audio_unit_latency_sec *
- format_.mSampleRate) + device_latency_frames + stream_latency_frames);
+ format_.mSampleRate) + device_latency_frames);
}
double AUAudioInputStream::GetCaptureLatency(
diff --git a/media/audio/mac/audio_low_latency_input_mac.h b/media/audio/mac/audio_low_latency_input_mac.h
index 1b79172..6b5c720 100644
--- a/media/audio/mac/audio_low_latency_input_mac.h
+++ b/media/audio/mac/audio_low_latency_input_mac.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -29,7 +29,7 @@
// - Calling Close() also leads to self destruction.
// - The latency consists of two parts:
// 1) Hardware latency, which includes Audio Unit latency, audio device
-// latency and audio stream latency;
+// latency;
// 2) The delay between the actual recording instant and the time when the
// data packet is provided as a callback.
//
diff --git a/media/audio/mac/audio_low_latency_output_mac.h b/media/audio/mac/audio_low_latency_output_mac.h
index f6e8649..fe29e90 100644
--- a/media/audio/mac/audio_low_latency_output_mac.h
+++ b/media/audio/mac/audio_low_latency_output_mac.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -10,7 +10,7 @@
// - Calling Close() also leads to self destruction.
// - The latency consists of two parts:
// 1) Hardware latency, which includes Audio Unit latency, audio device
-// latency and audio stream latency;
+// latency;
// 2) The delay between the moment getting the callback and the scheduled time
// stamp that tells when the data is going to be played out.
//