]>
Commit | Line | Data |
---|---|---|
f4a8da6a ER |
1 | diff --git a/media/audio/pulse/pulse_output.cc b/media/audio/pulse/pulse_output.cc |
2 | index c58d5bf..55ce3d2 100644 | |
3 | --- a/media/audio/pulse/pulse_output.cc | |
4 | +++ b/media/audio/pulse/pulse_output.cc | |
5 | @@ -126,7 +126,7 @@ void PulseAudioOutputStream::WriteRequestCallback(pa_stream* playback_handle, | |
6 | PulseAudioOutputStream* stream = | |
7 | reinterpret_cast<PulseAudioOutputStream*>(stream_addr); | |
8 | ||
9 | - DCHECK_EQ(stream->manager_->GetMessageLoop(), MessageLoop::current()); | |
10 | + DCHECK(stream->manager_->GetMessageLoop()->BelongsToCurrentThread()); | |
11 | ||
12 | stream->write_callback_handled_ = true; | |
13 | ||
14 | @@ -153,7 +153,7 @@ PulseAudioOutputStream::PulseAudioOutputStream(const AudioParameters& params, | |
15 | write_callback_handled_(false), | |
16 | ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), | |
17 | source_callback_(NULL) { | |
18 | - DCHECK_EQ(manager_->GetMessageLoop(), MessageLoop::current()); | |
19 | + DCHECK(manager_->GetMessageLoop()->BelongsToCurrentThread()); | |
20 | ||
21 | // TODO(slock): Sanity check input values. | |
22 | } | |
23 | @@ -167,7 +167,7 @@ PulseAudioOutputStream::~PulseAudioOutputStream() { | |
24 | } | |
25 | ||
26 | bool PulseAudioOutputStream::Open() { | |
27 | - DCHECK_EQ(manager_->GetMessageLoop(), MessageLoop::current()); | |
28 | + DCHECK(manager_->GetMessageLoop()->BelongsToCurrentThread()); | |
29 | ||
30 | // TODO(slock): Possibly move most of this to an OpenPlaybackDevice function | |
31 | // in a new class 'pulse_util', like alsa_util. | |
32 | @@ -270,7 +270,7 @@ void PulseAudioOutputStream::Reset() { | |
33 | } | |
34 | ||
35 | void PulseAudioOutputStream::Close() { | |
36 | - DCHECK_EQ(manager_->GetMessageLoop(), MessageLoop::current()); | |
37 | + DCHECK(manager_->GetMessageLoop()->BelongsToCurrentThread()); | |
38 | ||
39 | Reset(); | |
40 | ||
41 | @@ -280,7 +280,7 @@ void PulseAudioOutputStream::Close() { | |
42 | } | |
43 | ||
44 | void PulseAudioOutputStream::WaitForWriteRequest() { | |
45 | - DCHECK_EQ(manager_->GetMessageLoop(), MessageLoop::current()); | |
46 | + DCHECK(manager_->GetMessageLoop()->BelongsToCurrentThread()); | |
47 | ||
48 | if (stream_stopped_) | |
49 | return; | |
50 | @@ -382,7 +382,7 @@ void PulseAudioOutputStream::WriteToStream(size_t bytes_to_write, | |
51 | } | |
52 | ||
53 | void PulseAudioOutputStream::Start(AudioSourceCallback* callback) { | |
54 | - DCHECK_EQ(manager_->GetMessageLoop(), MessageLoop::current()); | |
55 | + DCHECK(manager_->GetMessageLoop()->BelongsToCurrentThread()); | |
56 | CHECK(callback); | |
57 | DLOG_IF(ERROR, !playback_handle_) | |
58 | << "Open() has not been called successfully"; | |
59 | @@ -402,19 +402,19 @@ void PulseAudioOutputStream::Start(AudioSourceCallback* callback) { | |
60 | } | |
61 | ||
62 | void PulseAudioOutputStream::Stop() { | |
63 | - DCHECK_EQ(manager_->GetMessageLoop(), MessageLoop::current()); | |
64 | + DCHECK(manager_->GetMessageLoop()->BelongsToCurrentThread()); | |
65 | ||
66 | stream_stopped_ = true; | |
67 | } | |
68 | ||
69 | void PulseAudioOutputStream::SetVolume(double volume) { | |
70 | - DCHECK_EQ(manager_->GetMessageLoop(), MessageLoop::current()); | |
71 | + DCHECK(manager_->GetMessageLoop()->BelongsToCurrentThread()); | |
72 | ||
73 | volume_ = static_cast<float>(volume); | |
74 | } | |
75 | ||
76 | void PulseAudioOutputStream::GetVolume(double* volume) { | |
77 | - DCHECK_EQ(manager_->GetMessageLoop(), MessageLoop::current()); | |
78 | + DCHECK(manager_->GetMessageLoop()->BelongsToCurrentThread()); | |
79 | ||
80 | *volume = volume_; | |
81 | } |