Handle the timer wrapping in the wave and null output devices
This commit is contained in:
parent
57a03bc2b5
commit
c58469e234
@ -55,9 +55,10 @@ static ALuint NullProc(ALvoid *ptr)
|
|||||||
avail = (ALuint64)(now-start) * Device->Frequency / 1000;
|
avail = (ALuint64)(now-start) * Device->Frequency / 1000;
|
||||||
if(avail < done)
|
if(avail < done)
|
||||||
{
|
{
|
||||||
AL_PRINT("Timer wrapped\n");
|
/* Timer wrapped. Add the remainder of the cycle to the available
|
||||||
aluHandleDisconnect(Device);
|
* count and reset the number of samples done */
|
||||||
break;
|
avail += 0xFFFFFFFFu*Device->Frequency/1000 - done;
|
||||||
|
done = 0;
|
||||||
}
|
}
|
||||||
if(avail-done < Device->UpdateSize)
|
if(avail-done < Device->UpdateSize)
|
||||||
{
|
{
|
||||||
|
@ -106,9 +106,10 @@ static ALuint WaveProc(ALvoid *ptr)
|
|||||||
avail = (ALuint64)(now-start) * pDevice->Frequency / 1000;
|
avail = (ALuint64)(now-start) * pDevice->Frequency / 1000;
|
||||||
if(avail < done)
|
if(avail < done)
|
||||||
{
|
{
|
||||||
AL_PRINT("Timer wrapped\n");
|
/* Timer wrapped. Add the remainder of the cycle to the available
|
||||||
aluHandleDisconnect(pDevice);
|
* count and reset the number of samples done */
|
||||||
break;
|
avail += 0xFFFFFFFFu*pDevice->Frequency/1000 - done;
|
||||||
|
done = 0;
|
||||||
}
|
}
|
||||||
if(avail-done < pDevice->UpdateSize)
|
if(avail-done < pDevice->UpdateSize)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user