aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/pulseaudio.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-07-24 19:14:32 -0700
committerChris Robinson <[email protected]>2010-07-24 19:14:32 -0700
commit40dd1fb85364e3a9e278ffa7a034638e7718770b (patch)
treeb4da0f38e57498b1c2e4b44986814f7e58d92ef6 /Alc/pulseaudio.c
parentab77fc14d53993e90403dd3474725a6202f623c4 (diff)
Add a backend callback to get the device time
The method should monotonically count the number of nanoseconds the device has active contexts
Diffstat (limited to 'Alc/pulseaudio.c')
-rw-r--r--Alc/pulseaudio.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c
index 2b68f166..2769fcd9 100644
--- a/Alc/pulseaudio.c
+++ b/Alc/pulseaudio.c
@@ -1204,6 +1204,12 @@ static void pulse_capture_samples(ALCdevice *device, ALCvoid *buffer, ALCuint sa
alcSetError(device, ALC_INVALID_VALUE);
} //}}}
+static ALuint64 pulse_get_time(ALCdevice *Device) //{{{
+{
+ return Device->SamplesPlayed * 1000000000 / Device->Frequency;
+} //}}}
+
+
BackendFuncs pulse_funcs = { //{{{
pulse_open_playback,
pulse_close_playback,
@@ -1214,7 +1220,8 @@ BackendFuncs pulse_funcs = { //{{{
pulse_start_capture,
pulse_stop_capture,
pulse_capture_samples,
- pulse_available_samples
+ pulse_available_samples,
+ pulse_get_time
}; //}}}
void alc_pulse_init(BackendFuncs *func_list) //{{{