Fix a timing bug with the null backend.

This commit is contained in:
David Reid
2018-11-15 20:11:48 +10:00
parent bd29bb0bad
commit 496ccdfcee
+1 -1
View File
@@ -4864,7 +4864,7 @@ mal_bool32 mal_device__get_current_frame__null(mal_device* pDevice, mal_uint32*
mal_assert(pCurrentPos != NULL); mal_assert(pCurrentPos != NULL);
*pCurrentPos = 0; *pCurrentPos = 0;
mal_uint64 currentFrameAbs = (mal_uint64)(mal_timer_get_time_in_seconds(&pDevice->null_device.timer) * pDevice->sampleRate) / pDevice->channels; mal_uint64 currentFrameAbs = (mal_uint64)(mal_timer_get_time_in_seconds(&pDevice->null_device.timer) * pDevice->sampleRate);
*pCurrentPos = (mal_uint32)(currentFrameAbs % pDevice->bufferSizeInFrames); *pCurrentPos = (mal_uint32)(currentFrameAbs % pDevice->bufferSizeInFrames);
return MAL_TRUE; return MAL_TRUE;