diff options
author | Chris Robinson <[email protected]> | 2014-12-17 10:10:28 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-12-17 10:10:28 -0800 |
commit | 4b91d34d5835f17b56d45d3fe1dfe65da1d43240 (patch) | |
tree | 9efcb1fe314a49bf98221b5cd30f2009e103f59e /Alc/backends/pulseaudio.c | |
parent | af193e9fb320d3b7ca8decab59d7ba074579c21f (diff) |
Set a couple pulse callbacks to NULL during reset, and minor cleanups
Diffstat (limited to 'Alc/backends/pulseaudio.c')
-rw-r--r-- | Alc/backends/pulseaudio.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c index c53283b5..ae7e4e85 100644 --- a/Alc/backends/pulseaudio.c +++ b/Alc/backends/pulseaudio.c @@ -405,8 +405,7 @@ error: return ALC_FALSE; } -static void pulse_close(pa_threaded_mainloop *loop, pa_context *context, - pa_stream *stream) +static void pulse_close(pa_threaded_mainloop *loop, pa_context *context, pa_stream *stream) { pa_threaded_mainloop_lock(loop); @@ -898,7 +897,9 @@ static ALCboolean ALCpulsePlayback_reset(ALCpulsePlayback *self) if(self->stream) { + pa_stream_set_state_callback(self->stream, NULL, NULL); pa_stream_set_moved_callback(self->stream, NULL, NULL); + pa_stream_set_write_callback(self->stream, NULL, NULL); pa_stream_set_buffer_attr_callback(self->stream, NULL, NULL); pa_stream_disconnect(self->stream); pa_stream_unref(self->stream); @@ -1572,11 +1573,6 @@ static void ALCpulseCapture_unlock(ALCpulseCapture *self) } -static inline void AppendAllDevicesList2(const DevMap *entry) -{ AppendAllDevicesList(al_string_get_cstr(entry->name)); } -static inline void AppendCaptureDeviceList2(const DevMap *entry) -{ AppendCaptureDeviceList(al_string_get_cstr(entry->name)); } - typedef struct ALCpulseBackendFactory { DERIVE_FROM_TYPE(ALCbackendFactory); } ALCpulseBackendFactory; @@ -1666,12 +1662,16 @@ static void ALCpulseBackendFactory_probe(ALCpulseBackendFactory* UNUSED(self), e { case ALL_DEVICE_PROBE: ALCpulsePlayback_probeDevices(); - VECTOR_FOR_EACH(const DevMap, PlaybackDevices, AppendAllDevicesList2); +#define APPEND_ALL_DEVICES_LIST(e) AppendAllDevicesList(al_string_get_cstr((e)->name)) + VECTOR_FOR_EACH(const DevMap, PlaybackDevices, APPEND_ALL_DEVICES_LIST); +#undef APPEND_ALL_DEVICES_LIST break; case CAPTURE_DEVICE_PROBE: ALCpulseCapture_probeDevices(); - VECTOR_FOR_EACH(const DevMap, CaptureDevices, AppendCaptureDeviceList2); +#define APPEND_CAPTURE_DEVICE_LIST(e) AppendCaptureDeviceList(al_string_get_cstr((e)->name)) + VECTOR_FOR_EACH(const DevMap, CaptureDevices, APPEND_CAPTURE_DEVICE_LIST); +#undef APPEND_CAPTURE_DEVICE_LIST break; } } |