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

Side by Side Diff: media/filters/null_audio_renderer.cc

Issue 100135: Fixes bug where NullAudioRenderer would join a previously joined thread. (Closed)
Patch Set: Created 11 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <cmath> 5 #include <cmath>
6 6
7 #include "media/base/filter_host.h" 7 #include "media/base/filter_host.h"
8 #include "media/filters/null_audio_renderer.h" 8 #include "media/filters/null_audio_renderer.h"
9 9
10 namespace media { 10 namespace media {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 buffer_.reset(new uint8[buffer_size_]); 79 buffer_.reset(new uint8[buffer_size_]);
80 DCHECK(buffer_.get()); 80 DCHECK(buffer_.get());
81 81
82 // It's safe to start the thread now because it simply sleeps when playback 82 // It's safe to start the thread now because it simply sleeps when playback
83 // rate is 0.0f. 83 // rate is 0.0f.
84 return PlatformThread::Create(0, this, &thread_); 84 return PlatformThread::Create(0, this, &thread_);
85 } 85 }
86 86
87 void NullAudioRenderer::OnStop() { 87 void NullAudioRenderer::OnStop() {
88 shutdown_ = true; 88 shutdown_ = true;
89 if (thread_) 89 if (thread_) {
90 PlatformThread::Join(thread_); 90 PlatformThread::Join(thread_);
91 thread_ = NULL;
92 }
91 } 93 }
92 94
93 } // namespace media 95 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698