From 40dd1fb85364e3a9e278ffa7a034638e7718770b Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 24 Jul 2010 19:14:32 -0700 Subject: Add a backend callback to get the device time The method should monotonically count the number of nanoseconds the device has active contexts --- Alc/oss.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Alc/oss.c') diff --git a/Alc/oss.c b/Alc/oss.c index ed96fa17..9f3e5ae2 100644 --- a/Alc/oss.c +++ b/Alc/oss.c @@ -465,6 +465,11 @@ static ALCuint oss_available_samples(ALCdevice *pDevice) return RingBufferSize(data->ring); } +static ALuint64 oss_get_time(ALCdevice *Device) +{ + return Device->SamplesPlayed * 1000000000 / Device->Frequency; +} + BackendFuncs oss_funcs = { oss_open_playback, @@ -476,7 +481,8 @@ BackendFuncs oss_funcs = { oss_start_capture, oss_stop_capture, oss_capture_samples, - oss_available_samples + oss_available_samples, + oss_get_time }; void alc_oss_init(BackendFuncs *func_list) -- cgit v1.2.3