diff options
Diffstat (limited to 'Alc/backends/mmdevapi.c')
-rw-r--r-- | Alc/backends/mmdevapi.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c index 938488ac..f102e385 100644 --- a/Alc/backends/mmdevapi.c +++ b/Alc/backends/mmdevapi.c @@ -508,7 +508,7 @@ static void ALCmmdevPlayback_stop(ALCmmdevPlayback *self); static void ALCmmdevPlayback_stopProxy(ALCmmdevPlayback *self); static DECLARE_FORWARD2(ALCmmdevPlayback, ALCbackend, ALCenum, captureSamples, ALCvoid*, ALCuint) static DECLARE_FORWARD(ALCmmdevPlayback, ALCbackend, ALCuint, availableSamples) -static ALint64 ALCmmdevPlayback_getLatency(ALCmmdevPlayback *self); +static ClockLatency ALCmmdevPlayback_getClockLatency(ALCmmdevPlayback *self); static DECLARE_FORWARD(ALCmmdevPlayback, ALCbackend, void, lock) static DECLARE_FORWARD(ALCmmdevPlayback, ALCbackend, void, unlock) DECLARE_DEFAULT_ALLOCATORS(ALCmmdevPlayback) @@ -1139,10 +1139,17 @@ static void ALCmmdevPlayback_stopProxy(ALCmmdevPlayback *self) } -static ALint64 ALCmmdevPlayback_getLatency(ALCmmdevPlayback *self) +static ClockLatency ALCmmdevPlayback_getClockLatency(ALCmmdevPlayback *self) { ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; - return (ALint64)self->Padding * 1000000000 / device->Frequency; + ClockLatency ret; + + ALCmmdevPlayback_lock(self); + ret.ClockTime = GetDeviceClockTime(device); + ret.Latency = self->Padding * DEVICE_CLOCK_RES / device->Frequency; + ALCmmdevPlayback_unlock(self); + + return ret; } @@ -1181,7 +1188,7 @@ static void ALCmmdevCapture_stop(ALCmmdevCapture *self); static void ALCmmdevCapture_stopProxy(ALCmmdevCapture *self); static ALCenum ALCmmdevCapture_captureSamples(ALCmmdevCapture *self, ALCvoid *buffer, ALCuint samples); static ALuint ALCmmdevCapture_availableSamples(ALCmmdevCapture *self); -static DECLARE_FORWARD(ALCmmdevCapture, ALCbackend, ALint64, getLatency) +static DECLARE_FORWARD(ALCmmdevCapture, ALCbackend, ClockLatency, getClockLatency) static DECLARE_FORWARD(ALCmmdevCapture, ALCbackend, void, lock) static DECLARE_FORWARD(ALCmmdevCapture, ALCbackend, void, unlock) DECLARE_DEFAULT_ALLOCATORS(ALCmmdevCapture) |