aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/pulseaudio.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-08-13 12:28:46 -0700
committerChris Robinson <[email protected]>2009-08-13 12:28:46 -0700
commit243939f94f26b1840255590b2454e931374de73f (patch)
tree2739c389486d703c5d31ab262aecb1be02d11b5c /Alc/pulseaudio.c
parent739385bd89c4eaae662ee1e017f74ba0da31f350 (diff)
Allow delaying playback start until context creation, and don't use UpdateSize to store the buffer size
This will make it possible to support the context attributes (frequency, refresh, etc) for some backends
Diffstat (limited to 'Alc/pulseaudio.c')
-rw-r--r--Alc/pulseaudio.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c
index 874b5ca4..fc853faf 100644
--- a/Alc/pulseaudio.c
+++ b/Alc/pulseaudio.c
@@ -239,7 +239,7 @@ static ALCboolean pulse_open(ALCdevice *device, ALCchar *device_name, ALCenum fo
}
else
{
- data->attr.tlength = data->frame_size * (device->UpdateSize&~3);
+ data->attr.tlength = data->frame_size * (device->BufferSize&~3);
data->attr.fragsize = -1;
data->stream_name = "Playback Stream";
}
@@ -377,7 +377,7 @@ static ALCboolean pulse_open(ALCdevice *device, ALCchar *device_name, ALCenum fo
ppa_threaded_mainloop_accept(data->loop);
}
- device->UpdateSize /= 4;
+ device->UpdateSize = device->BufferSize/4;
ppa_threaded_mainloop_unlock(data->loop);
return ALC_TRUE;
@@ -446,6 +446,20 @@ static void pulse_close_playback(ALCdevice *device) //{{{
pulse_close(device);
} //}}}
+static ALCboolean pulse_start_context(ALCdevice *device, ALCcontext *context) //{{{
+{
+ return ALC_TRUE;
+ (void)device;
+ (void)context;
+} //}}}
+
+static void pulse_stop_context(ALCdevice *device, ALCcontext *context) //{{{
+{
+ (void)device;
+ (void)context;
+} //}}}
+
+
static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_name, ALCuint frequency, ALCenum format, ALCsizei samples) //{{{
{
if(!pa_handle)
@@ -503,6 +517,8 @@ static ALCuint pulse_available_samples(ALCdevice *device) //{{{
BackendFuncs pulse_funcs = { //{{{
pulse_open_playback,
pulse_close_playback,
+ pulse_start_context,
+ pulse_stop_context,
pulse_open_capture,
pulse_close_capture,
pulse_start_capture,