aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alsa.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-07-25 12:54:50 -0700
committerChris Robinson <[email protected]>2010-07-25 12:54:50 -0700
commit46d46c49a87b33ed727a7099aca3dc89e06e57cd (patch)
treefb5e8d5611de607f6ddb707e1406d71e0bbe251d /Alc/alsa.c
parent40dd1fb85364e3a9e278ffa7a034638e7718770b (diff)
Store the time precision with the device
Diffstat (limited to 'Alc/alsa.c')
-rw-r--r--Alc/alsa.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Alc/alsa.c b/Alc/alsa.c
index 80825b02..4d1d58b3 100644
--- a/Alc/alsa.c
+++ b/Alc/alsa.c
@@ -695,6 +695,9 @@ static ALCboolean alsa_reset_playback(ALCdevice *device)
psnd_pcm_sw_params_free(sp);
+ device->TimeRes = (ALuint64)periodSizeInFrames * 1000000000 / rate;
+ device->Frequency = rate;
+
SetDefaultChannelOrder(device);
data->size = psnd_pcm_frames_to_bytes(data->pcmHandle, periodSizeInFrames);
@@ -711,7 +714,6 @@ static ALCboolean alsa_reset_playback(ALCdevice *device)
}
device->UpdateSize = periodSizeInFrames;
device->NumUpdates = periods;
- device->Frequency = rate;
data->thread = StartThread(ALSANoMMapProc, device);
}
else
@@ -724,7 +726,6 @@ static ALCboolean alsa_reset_playback(ALCdevice *device)
}
device->UpdateSize = periodSizeInFrames;
device->NumUpdates = periods;
- device->Frequency = rate;
data->thread = StartThread(ALSAProc, device);
}
if(data->thread == NULL)