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

Unified Diff: media/audio/sounds/audio_stream_handler.cc

Issue 102693003: Fix flaky AudioStreamHandler initialization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/sounds/audio_stream_handler.cc
diff --git a/media/audio/sounds/audio_stream_handler.cc b/media/audio/sounds/audio_stream_handler.cc
index 141392c1c3c1a7debec8c74d7f65717bc6de8f4f..08608ac4187aa0863b777e5e42701f2b7a327f69 100644
--- a/media/audio/sounds/audio_stream_handler.cc
+++ b/media/audio/sounds/audio_stream_handler.cc
@@ -19,6 +19,9 @@ namespace {
// Volume percent.
const double kOutputVolumePercent = 0.8;
+// The number of frames each OnMoreData() call will request.
+const int kDefaultFrameCount = 1024;
+
AudioStreamHandler::TestObserver* g_observer_for_testing = NULL;
AudioOutputStream::AudioSourceCallback* g_audio_source_for_testing = NULL;
@@ -124,12 +127,11 @@ AudioStreamHandler::AudioStreamHandler(const base::StringPiece& wav_data)
LOG(ERROR) << "Can't get access to audio manager.";
return;
}
- AudioParameters params(
- AudioParameters::AUDIO_PCM_LOW_LATENCY,
- GuessChannelLayout(wav_audio_.num_channels()),
- wav_audio_.sample_rate(),
- wav_audio_.bits_per_sample(),
- manager->GetDefaultOutputStreamParameters().frames_per_buffer());
+ AudioParameters params(AudioParameters::AUDIO_PCM_LOW_LATENCY,
+ GuessChannelLayout(wav_audio_.num_channels()),
+ wav_audio_.sample_rate(),
+ wav_audio_.bits_per_sample(),
+ kDefaultFrameCount);
if (!params.IsValid()) {
LOG(ERROR) << "Audio params are invalid.";
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698