diff options
author | Chris Robinson <[email protected]> | 2010-07-24 19:14:32 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-07-24 19:14:32 -0700 |
commit | 40dd1fb85364e3a9e278ffa7a034638e7718770b (patch) | |
tree | b4da0f38e57498b1c2e4b44986814f7e58d92ef6 /Alc/portaudio.c | |
parent | ab77fc14d53993e90403dd3474725a6202f623c4 (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/portaudio.c')
-rw-r--r-- | Alc/portaudio.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Alc/portaudio.c b/Alc/portaudio.c index 2b8e0fa4..94eca19e 100644 --- a/Alc/portaudio.c +++ b/Alc/portaudio.c @@ -392,6 +392,11 @@ static ALCuint pa_available_samples(ALCdevice *device) return RingBufferSize(data->ring); } +static ALuint64 pa_get_time(ALCdevice *Device) +{ + return Device->SamplesPlayed * 1000000000 / Device->Frequency; +} + static const BackendFuncs pa_funcs = { pa_open_playback, @@ -403,7 +408,8 @@ static const BackendFuncs pa_funcs = { pa_start_capture, pa_stop_capture, pa_capture_samples, - pa_available_samples + pa_available_samples, + pa_get_time }; void alc_pa_init(BackendFuncs *func_list) |