summaryrefslogtreecommitdiff
path: root/src/OutputControl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/OutputControl.cxx')
-rw-r--r--src/OutputControl.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/OutputControl.cxx b/src/OutputControl.cxx
index 3dc9c470b..4a3552c17 100644
--- a/src/OutputControl.cxx
+++ b/src/OutputControl.cxx
@@ -107,7 +107,7 @@ audio_output_set_replay_gain_mode(struct audio_output *ao,
void
audio_output_enable(struct audio_output *ao)
{
- if (ao->thread == NULL) {
+ if (!ao->thread.IsDefined()) {
if (ao->plugin->enable == NULL) {
/* don't bother to start the thread now if the
device doesn't even have a enable() method;
@@ -125,7 +125,7 @@ audio_output_enable(struct audio_output *ao)
void
audio_output_disable(struct audio_output *ao)
{
- if (ao->thread == NULL) {
+ if (!ao->thread.IsDefined()) {
if (ao->plugin->disable == NULL)
ao->really_enabled = false;
else
@@ -184,7 +184,7 @@ audio_output_open(struct audio_output *ao,
ao->pipe = ∓
- if (ao->thread == NULL)
+ if (!ao->thread.IsDefined())
audio_output_thread_start(ao);
ao_command(ao, ao->open ? AO_COMMAND_REOPEN : AO_COMMAND_OPEN);
@@ -322,11 +322,10 @@ void audio_output_finish(struct audio_output *ao)
assert(ao->fail_timer == NULL);
- if (ao->thread != NULL) {
+ if (ao->thread.IsDefined()) {
assert(ao->allow_play);
ao_lock_command(ao, AO_COMMAND_KILL);
- g_thread_join(ao->thread);
- ao->thread = NULL;
+ ao->thread.Join();
}
audio_output_free(ao);