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

Side by Side Diff: media/audio/audio_manager_base.cc

Issue 61203008: Attempt to fix audio wedges by restarting all streams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/audio/audio_manager_base.h" 5 #include "media/audio/audio_manager_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 412 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
413 int buffer_size = 0; 413 int buffer_size = 0;
414 std::string buffer_size_str(cmd_line->GetSwitchValueASCII( 414 std::string buffer_size_str(cmd_line->GetSwitchValueASCII(
415 switches::kAudioBufferSize)); 415 switches::kAudioBufferSize));
416 if (base::StringToInt(buffer_size_str, &buffer_size) && buffer_size > 0) 416 if (base::StringToInt(buffer_size_str, &buffer_size) && buffer_size > 0)
417 return buffer_size; 417 return buffer_size;
418 418
419 return 0; 419 return 0;
420 } 420 }
421 421
422 void AudioManagerBase::FixWedgedAudio() {
423 DCHECK(message_loop_->BelongsToCurrentThread());
424 // Close all active streams across all dispatchers.
scherkus (not reviewing) 2013/12/02 21:49:37 these two comments aren't very helpful it'd be mo
DaleCurtis 2013/12/02 22:52:08 Done.
425 for (AudioOutputDispatchers::iterator it = output_dispatchers_.begin();
426 it != output_dispatchers_.end(); ++it) {
427 (*it)->dispatcher->CloseStreamsForWedgeFix();
428 }
429 // Recreate all active streams across all dispatchers.
430 for (AudioOutputDispatchers::iterator it = output_dispatchers_.begin();
431 it != output_dispatchers_.end(); ++it) {
432 (*it)->dispatcher->RestartStreamsForWedgeFix();
433 }
434 }
435
422 } // namespace media 436 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698