diff options
author | Max Kellermann <max@duempel.org> | 2013-09-26 21:51:45 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-09-26 21:51:45 +0200 |
commit | ce1d8975751251d49581129193e09490ca650a8b (patch) | |
tree | 27eda9989e35a74ccdade4924c47391ce2ee56b6 /src/OutputControl.cxx | |
parent | 17e108a10a79a5cfb44981323442c92e35813e98 (diff) |
MusicPipe: expose the C++ API
Diffstat (limited to 'src/OutputControl.cxx')
-rw-r--r-- | src/OutputControl.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/OutputControl.cxx b/src/OutputControl.cxx index 820713593..2b372c5b7 100644 --- a/src/OutputControl.cxx +++ b/src/OutputControl.cxx @@ -141,14 +141,13 @@ audio_output_disable(struct audio_output *ao) static bool audio_output_open(struct audio_output *ao, const AudioFormat audio_format, - const struct music_pipe *mp) + const MusicPipe &mp) { bool open; assert(ao != NULL); assert(ao->allow_play); assert(audio_format.IsValid()); - assert(mp != NULL); if (ao->fail_timer != NULL) { g_timer_destroy(ao->fail_timer); @@ -156,12 +155,12 @@ audio_output_open(struct audio_output *ao, } if (ao->open && audio_format == ao->in_audio_format) { - assert(ao->pipe == mp || + assert(ao->pipe == &mp || (ao->always_on && ao->pause)); if (ao->pause) { ao->chunk = NULL; - ao->pipe = mp; + ao->pipe = ∓ /* unpause with the CANCEL command; this is a hack, but suits well for forcing the thread @@ -179,7 +178,7 @@ audio_output_open(struct audio_output *ao, ao->in_audio_format = audio_format; ao->chunk = NULL; - ao->pipe = mp; + ao->pipe = ∓ if (ao->thread == NULL) audio_output_thread_start(ao); @@ -223,10 +222,8 @@ audio_output_close_locked(struct audio_output *ao) bool audio_output_update(struct audio_output *ao, const AudioFormat audio_format, - const struct music_pipe *mp) + const MusicPipe &mp) { - assert(mp != NULL); - const ScopeLock protect(ao->mutex); if (ao->enabled && ao->really_enabled) { |