aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/ALc.c2
-rw-r--r--Alc/alsa.c8
-rw-r--r--Alc/dsound.c8
-rw-r--r--Alc/null.c8
-rw-r--r--Alc/oss.c8
-rw-r--r--Alc/portaudio.c8
-rw-r--r--Alc/pulseaudio.c9
-rw-r--r--Alc/solaris.c8
-rw-r--r--Alc/wave.c8
-rw-r--r--Alc/winmm.c8
-rw-r--r--OpenAL32/Include/alMain.h3
11 files changed, 68 insertions, 10 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index fe5eeecd..93ee4b7d 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -39,7 +39,7 @@
#include "alu.h"
-#define EmptyFuncs { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
+#define EmptyFuncs { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
typedef struct BackendInfo {
const char *name;
void (*Init)(BackendFuncs*);
diff --git a/Alc/alsa.c b/Alc/alsa.c
index 24fcd7b8..80825b02 100644
--- a/Alc/alsa.c
+++ b/Alc/alsa.c
@@ -1002,6 +1002,11 @@ static void alsa_capture_samples(ALCdevice *Device, ALCvoid *Buffer, ALCuint Sam
alcSetError(Device, ALC_INVALID_VALUE);
}
+static ALuint64 alsa_get_time(ALCdevice *Device)
+{
+ return Device->SamplesPlayed * 1000000000 / Device->Frequency;
+}
+
BackendFuncs alsa_funcs = {
alsa_open_playback,
@@ -1013,7 +1018,8 @@ BackendFuncs alsa_funcs = {
alsa_start_capture,
alsa_stop_capture,
alsa_capture_samples,
- alsa_available_samples
+ alsa_available_samples,
+ alsa_get_time
};
void alc_alsa_init(BackendFuncs *func_list)
diff --git a/Alc/dsound.c b/Alc/dsound.c
index 3365f5ef..f636287f 100644
--- a/Alc/dsound.c
+++ b/Alc/dsound.c
@@ -538,6 +538,11 @@ static ALCuint DSoundAvailableSamples(ALCdevice *pDevice)
return 0;
}
+static ALuint64 DSoundGetTime(ALCdevice *Device)
+{
+ return Device->SamplesPlayed * 1000000000 / Device->Frequency;
+}
+
BackendFuncs DSoundFuncs = {
DSoundOpenPlayback,
@@ -549,7 +554,8 @@ BackendFuncs DSoundFuncs = {
DSoundStartCapture,
DSoundStopCapture,
DSoundCaptureSamples,
- DSoundAvailableSamples
+ DSoundAvailableSamples,
+ DSoundGetTime
};
diff --git a/Alc/null.c b/Alc/null.c
index 86726fc3..be760e7d 100644
--- a/Alc/null.c
+++ b/Alc/null.c
@@ -144,6 +144,11 @@ static ALCboolean null_open_capture(ALCdevice *device, const ALCchar *deviceName
return ALC_FALSE;
}
+static ALuint64 null_get_time(ALCdevice *Device)
+{
+ return Device->SamplesPlayed * 1000000000 / Device->Frequency;
+}
+
BackendFuncs null_funcs = {
null_open_playback,
@@ -155,7 +160,8 @@ BackendFuncs null_funcs = {
NULL,
NULL,
NULL,
- NULL
+ NULL,
+ null_get_time
};
void alc_null_init(BackendFuncs *func_list)
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)
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)
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) //{{{
diff --git a/Alc/solaris.c b/Alc/solaris.c
index 444cab58..cff744ae 100644
--- a/Alc/solaris.c
+++ b/Alc/solaris.c
@@ -266,6 +266,11 @@ static ALCuint solaris_available_samples(ALCdevice *pDevice)
return 0;
}
+static ALuint64 solaris_get_time(ALCdevice *Device)
+{
+ return Device->SamplesPlayed * 1000000000 / Device->Frequency;
+}
+
BackendFuncs solaris_funcs = {
solaris_open_playback,
@@ -277,7 +282,8 @@ BackendFuncs solaris_funcs = {
solaris_start_capture,
solaris_stop_capture,
solaris_capture_samples,
- solaris_available_samples
+ solaris_available_samples,
+ solaris_get_time
};
void alc_solaris_init(BackendFuncs *func_list)
diff --git a/Alc/wave.c b/Alc/wave.c
index 62c3ffc2..61a93570 100644
--- a/Alc/wave.c
+++ b/Alc/wave.c
@@ -334,6 +334,11 @@ static ALCboolean wave_open_capture(ALCdevice *pDevice, const ALCchar *deviceNam
return ALC_FALSE;
}
+static ALuint64 wave_get_time(ALCdevice *Device)
+{
+ return Device->SamplesPlayed * 1000000000 / Device->Frequency;
+}
+
BackendFuncs wave_funcs = {
wave_open_playback,
@@ -345,7 +350,8 @@ BackendFuncs wave_funcs = {
NULL,
NULL,
NULL,
- NULL
+ NULL,
+ wave_get_time
};
void alc_wave_init(BackendFuncs *func_list)
diff --git a/Alc/winmm.c b/Alc/winmm.c
index 317906f7..70398a17 100644
--- a/Alc/winmm.c
+++ b/Alc/winmm.c
@@ -397,6 +397,11 @@ static void WinMMCaptureSamples(ALCdevice *pDevice, ALCvoid *pBuffer, ALCuint lS
alcSetError(pDevice, ALC_INVALID_VALUE);
}
+static ALuint64 WinMMGetTime(ALCdevice *Device)
+{
+ return Device->SamplesPlayed * 1000000000 / Device->Frequency;
+}
+
static BackendFuncs WinMMFuncs = {
WinMMOpenPlayback,
@@ -408,7 +413,8 @@ static BackendFuncs WinMMFuncs = {
WinMMStartCapture,
WinMMStopCapture,
WinMMCaptureSamples,
- WinMMAvailableSamples
+ WinMMAvailableSamples,
+ WinMMGetTime
};
void alcWinMMInit(BackendFuncs *FuncList)
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index d9c369ef..5791b336 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -273,6 +273,8 @@ typedef struct {
void (*StopCapture)(ALCdevice*);
void (*CaptureSamples)(ALCdevice*, void*, ALCuint);
ALCuint (*AvailableSamples)(ALCdevice*);
+
+ ALuint64 (*GetTime)(ALCdevice*);
} BackendFuncs;
enum {
@@ -424,6 +426,7 @@ struct ALCdevice_struct
#define ALCdevice_StopCapture(a) ((a)->Funcs->StopCapture((a)))
#define ALCdevice_CaptureSamples(a,b,c) ((a)->Funcs->CaptureSamples((a), (b), (c)))
#define ALCdevice_AvailableSamples(a) ((a)->Funcs->AvailableSamples((a)))
+#define ALCdevice_GetTime(a) ((a)->Funcs->GetTime((a)))
struct ALCcontext_struct
{