Chromium Code Reviews| 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); |