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

Unified Diff: media/audio/audio_output_dispatcher_impl.cc

Issue 10958020: Don't fallback if we've successfully opened a stream previously. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments w/o state machine. Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: media/audio/audio_output_dispatcher_impl.cc
diff --git a/media/audio/audio_output_dispatcher_impl.cc b/media/audio/audio_output_dispatcher_impl.cc
index dbf8ab0794b9d6be95d014f8b58ccf5ad829342e..d2542786ba7e9acd7e5f4e7936aa899299a78a0e 100644
--- a/media/audio/audio_output_dispatcher_impl.cc
+++ b/media/audio/audio_output_dispatcher_impl.cc
@@ -44,8 +44,10 @@ bool AudioOutputDispatcherImpl::OpenStream() {
paused_proxies_++;
// Ensure that there is at least one open stream.
- if (idle_streams_.empty() && !CreateAndOpenStream())
+ if (idle_streams_.empty() && !CreateAndOpenStream()) {
+ paused_proxies_--;
tommi (sloooow) - chröme 2012/09/21 08:46:27 I'm curious - why not move the ++ below the if ins
DaleCurtis 2012/09/21 17:07:59 That would have made too much sense for this class
return false;
+ }
close_timer_.Reset();
return true;
@@ -84,11 +86,7 @@ void AudioOutputDispatcherImpl::StopStream(AudioOutputProxy* stream_proxy) {
DCHECK_EQ(MessageLoop::current(), message_loop_);
AudioStreamMap::iterator it = proxy_to_physical_map_.find(stream_proxy);
- // StopStream() may have already been called.
- // TODO(dalecurtis): StopStream() shouldn't be called twice! See:
- // http://crbug.com/149815 and http://crbug.com/150619
- if (it == proxy_to_physical_map_.end())
- return;
+ DCHECK(it != proxy_to_physical_map_.end());
AudioOutputStream* physical_stream = it->second;
proxy_to_physical_map_.erase(it);

Powered by Google App Engine
This is Rietveld 408576698