void-packages/srcpkgs/chromium-unstable/patches/pulse-compile-fix.diff

82 lines
3.0 KiB
Diff

diff --git media/audio/pulse/pulse_output.cc b/media/audio/pulse/pulse_output.cc
index c58d5bf..55ce3d2 100644
--- media/audio/pulse/pulse_output.cc
+++ media/audio/pulse/pulse_output.cc
@@ -126,7 +126,7 @@ void PulseAudioOutputStream::WriteRequestCallback(pa_stream* playback_handle,
PulseAudioOutputStream* stream =
reinterpret_cast<PulseAudioOutputStream*>(stream_addr);
- DCHECK_EQ(stream->manager_->GetMessageLoop(), MessageLoop::current());
+ DCHECK(stream->manager_->GetMessageLoop()->BelongsToCurrentThread());
stream->write_callback_handled_ = true;
@@ -153,7 +153,7 @@ PulseAudioOutputStream::PulseAudioOutputStream(const AudioParameters& params,
write_callback_handled_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
source_callback_(NULL) {
- DCHECK_EQ(manager_->GetMessageLoop(), MessageLoop::current());
+ DCHECK(manager_->GetMessageLoop()->BelongsToCurrentThread());
// TODO(slock): Sanity check input values.
}
@@ -167,7 +167,7 @@ PulseAudioOutputStream::~PulseAudioOutputStream() {
}
bool PulseAudioOutputStream::Open() {
- DCHECK_EQ(manager_->GetMessageLoop(), MessageLoop::current());
+ DCHECK(manager_->GetMessageLoop()->BelongsToCurrentThread());
// TODO(slock): Possibly move most of this to an OpenPlaybackDevice function
// in a new class 'pulse_util', like alsa_util.
@@ -270,7 +270,7 @@ void PulseAudioOutputStream::Reset() {
}
void PulseAudioOutputStream::Close() {
- DCHECK_EQ(manager_->GetMessageLoop(), MessageLoop::current());
+ DCHECK(manager_->GetMessageLoop()->BelongsToCurrentThread());
Reset();
@@ -280,7 +280,7 @@ void PulseAudioOutputStream::Close() {
}
void PulseAudioOutputStream::WaitForWriteRequest() {
- DCHECK_EQ(manager_->GetMessageLoop(), MessageLoop::current());
+ DCHECK(manager_->GetMessageLoop()->BelongsToCurrentThread());
if (stream_stopped_)
return;
@@ -382,7 +382,7 @@ void PulseAudioOutputStream::WriteToStream(size_t bytes_to_write,
}
void PulseAudioOutputStream::Start(AudioSourceCallback* callback) {
- DCHECK_EQ(manager_->GetMessageLoop(), MessageLoop::current());
+ DCHECK(manager_->GetMessageLoop()->BelongsToCurrentThread());
CHECK(callback);
DLOG_IF(ERROR, !playback_handle_)
<< "Open() has not been called successfully";
@@ -402,19 +402,19 @@ void PulseAudioOutputStream::Start(AudioSourceCallback* callback) {
}
void PulseAudioOutputStream::Stop() {
- DCHECK_EQ(manager_->GetMessageLoop(), MessageLoop::current());
+ DCHECK(manager_->GetMessageLoop()->BelongsToCurrentThread());
stream_stopped_ = true;
}
void PulseAudioOutputStream::SetVolume(double volume) {
- DCHECK_EQ(manager_->GetMessageLoop(), MessageLoop::current());
+ DCHECK(manager_->GetMessageLoop()->BelongsToCurrentThread());
volume_ = static_cast<float>(volume);
}
void PulseAudioOutputStream::GetVolume(double* volume) {
- DCHECK_EQ(manager_->GetMessageLoop(), MessageLoop::current());
+ DCHECK(manager_->GetMessageLoop()->BelongsToCurrentThread());
*volume = volume_;
}