summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 04:23:51 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 04:23:51 +0000
commit403fe1585a183e133108e5a1564226e4f7654143 (patch)
treed049530379efe20a7cd01fd32a75ad40e8381b47 /media
parent97d2c1ead3b1dfc2f40f0de9123a3d0ed5edff23 (diff)
downloadchromium_src-403fe1585a183e133108e5a1564226e4f7654143.zip
chromium_src-403fe1585a183e133108e5a1564226e4f7654143.tar.gz
chromium_src-403fe1585a183e133108e5a1564226e4f7654143.tar.bz2
Fix crash in AudioRendererImpl by adding a MessageLoop DestructionObserver.
Wrote unit tests for the entire class and fixed some other bugs that cropped up. BUG=25075 TEST=unit_tests, also closing tabs/browser shouldn't try to use dead IO loop Review URL: http://codereview.chromium.org/363007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31070 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/filters/audio_renderer_base.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/media/filters/audio_renderer_base.cc b/media/filters/audio_renderer_base.cc
index 65829f6..4ec7403 100644
--- a/media/filters/audio_renderer_base.cc
+++ b/media/filters/audio_renderer_base.cc
@@ -131,6 +131,13 @@ void AudioRendererBase::OnReadComplete(Buffer* buffer_in) {
DCHECK_GT(pending_reads_, 0u);
--pending_reads_;
+ // TODO(scherkus): this happens due to a race, primarily because Stop() is a
+ // synchronous call when it should be asynchronous and accept a callback.
+ // Refer to http://crbug.com/16059
+ if (state_ == kStopped) {
+ return;
+ }
+
// Don't enqueue an end-of-stream buffer because it has no data.
if (buffer_in->IsEndOfStream()) {
recieved_end_of_stream_ = true;