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

Issue 10958020: Don't fallback if we've successfully opened a stream previously. (Closed)

Created:
8 years, 3 months ago by DaleCurtis
Modified:
8 years, 3 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Visibility:
Public.

Description

Don't fallback if we've successfully opened a stream previously. Fixes an issue where we've opened streams through the AudioOutputDispatcher successfully, but eventually fail to open a stream. At this point the old code would try to fallback to the high latency audio path and in the process destroy the old AudioOutputDispatcher during Initialize()... leaving a bunch of physical audio streams in the ether calling OnMoreDataResampler callbacks which no longer have a way to stop the associated stream before being deleted. This also explains the "double-Stop()" errors from issue 149815, since they were not double-Stop() but rather Stop() on an AudioOutputProxy that the new dispatcher didn't know about. Rolls in the following fixes as well: - Replaces lock with message_loop_ check. - Fixes an issue where physical streams were incorrectly closed on Open failure. - Rollback of previous double-Stop() and CHECK() changes. BUG=150619 TEST=new media unittest. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=157940

Patch Set 1 #

Patch Set 2 : Revert double-stop() change. #

Total comments: 10

Patch Set 3 : Comments w/o state machine. #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+146 lines, -62 lines) Patch
M media/audio/audio_output_dispatcher_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M media/audio/audio_output_dispatcher_impl.cc View 1 2 chunks +4 lines, -6 lines 2 comments Download
M media/audio/audio_output_proxy.h View 1 chunk +2 lines, -1 line 0 comments Download
M media/audio/audio_output_proxy.cc View 1 2 3 chunks +10 lines, -7 lines 0 comments Download
M media/audio/audio_output_proxy_unittest.cc View 1 2 1 chunk +73 lines, -0 lines 2 comments Download
M media/audio/audio_output_resampler.h View 4 chunks +7 lines, -6 lines 0 comments Download
M media/audio/audio_output_resampler.cc View 1 2 5 chunks +49 lines, -41 lines 1 comment Download

Messages

Total messages: 11 (0 generated)
DaleCurtis
I think this is it!
8 years, 3 months ago (2012-09-20 21:12:01 UTC) #1
DaleCurtis
On 2012/09/20 21:12:01, DaleCurtis wrote: > I think this is it! To confirm, this is ...
8 years, 3 months ago (2012-09-20 21:45:01 UTC) #2
scherkus (not reviewing)
https://codereview.chromium.org/10958020/diff/4003/media/audio/audio_output_proxy.cc File media/audio/audio_output_proxy.cc (right): https://codereview.chromium.org/10958020/diff/4003/media/audio/audio_output_proxy.cc#newcode76 media/audio/audio_output_proxy.cc:76: dispatcher_->CloseStream(this); so to confirm... kStartError means Open() was successful ...
8 years, 3 months ago (2012-09-21 01:24:18 UTC) #3
DaleCurtis
PTAL. Lets get this in tonight. https://codereview.chromium.org/10958020/diff/4003/media/audio/audio_output_proxy.cc File media/audio/audio_output_proxy.cc (right): https://codereview.chromium.org/10958020/diff/4003/media/audio/audio_output_proxy.cc#newcode76 media/audio/audio_output_proxy.cc:76: dispatcher_->CloseStream(this); On 2012/09/21 ...
8 years, 3 months ago (2012-09-21 02:57:27 UTC) #4
DaleCurtis
+henrika fyi.
8 years, 3 months ago (2012-09-21 03:21:39 UTC) #5
scherkus (not reviewing)
LGTM w/ old OpenStream It should get cleaned up along with AOP/AODimpl On Sep 20, ...
8 years, 3 months ago (2012-09-21 03:27:33 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dalecurtis@chromium.org/10958020/5012
8 years, 3 months ago (2012-09-21 03:44:23 UTC) #7
tommi (sloooow) - chröme
Great work Dale! https://codereview.chromium.org/10958020/diff/5012/media/audio/audio_output_dispatcher_impl.cc File media/audio/audio_output_dispatcher_impl.cc (right): https://codereview.chromium.org/10958020/diff/5012/media/audio/audio_output_dispatcher_impl.cc#newcode48 media/audio/audio_output_dispatcher_impl.cc:48: paused_proxies_--; I'm curious - why not ...
8 years, 3 months ago (2012-09-21 08:46:27 UTC) #8
henrika (OOO until Aug 14)
Thanks Dale! Glad to see that we are now making the changes on platform-generic level ...
8 years, 3 months ago (2012-09-21 09:27:30 UTC) #9
henrika (OOO until Aug 14)
https://codereview.chromium.org/10958020/diff/5012/media/audio/audio_output_proxy_unittest.cc File media/audio/audio_output_proxy_unittest.cc (right): https://codereview.chromium.org/10958020/diff/5012/media/audio/audio_output_proxy_unittest.cc#newcode872 media/audio/audio_output_proxy_unittest.cc:872: TEST_F(AudioOutputResamplerTest, LowLatencyOpenEventuallyFails) { +1
8 years, 3 months ago (2012-09-21 09:27:40 UTC) #10
DaleCurtis
8 years, 3 months ago (2012-09-21 17:07:59 UTC) #11
Sorry all this mess ended up being some bad code on my part guys.  I completely
agree with Henrik that we need to collapse this unholy chain of classes into
something more readable.

The headaches AudioOutputProxy -> AudioOutputResampler ->
AudioOutputDispatcherImpl -> AudioOutputDispatcher and their interactions with
both AudioOutputController and AudioManager*  are extremely hard to follow.

AudioOutputMixer is a good step in the right direction since it does away with
AudioOutputDispatcherImpl and could even do away with
AudioOutputProxy/AudioOutputDispatcher.

As we're implementing channel mixing in the coming weeks I'll keep an eye out
for ways we can simplify this beast.

http://codereview.chromium.org/10958020/diff/5012/media/audio/audio_output_di...
File media/audio/audio_output_dispatcher_impl.cc (right):

http://codereview.chromium.org/10958020/diff/5012/media/audio/audio_output_di...
media/audio/audio_output_dispatcher_impl.cc:48: paused_proxies_--;
On 2012/09/21 08:46:27, tommi wrote:
> I'm curious - why not move the ++ below the if instead?

That would have made too much sense for this class. :) I'll tag it for cleanup.

Powered by Google App Engine
This is Rietveld 408576698