diff options
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 2 | ||||
-rw-r--r-- | Alc/alsa.c | 5 | ||||
-rw-r--r-- | Alc/dsound.c | 2 | ||||
-rw-r--r-- | Alc/null.c | 3 | ||||
-rw-r--r-- | Alc/oss.c | 2 | ||||
-rw-r--r-- | Alc/portaudio.c | 2 | ||||
-rw-r--r-- | Alc/pulseaudio.c | 3 | ||||
-rw-r--r-- | Alc/solaris.c | 2 | ||||
-rw-r--r-- | Alc/wave.c | 2 |
9 files changed, 21 insertions, 2 deletions
@@ -1995,6 +1995,8 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName) device->SamplesPlayed = 0; + device->TimeRes = 1; + InitUIntMap(&device->BufferMap); InitUIntMap(&device->EffectMap); InitUIntMap(&device->FilterMap); @@ -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) diff --git a/Alc/dsound.c b/Alc/dsound.c index f636287f..f513f2ef 100644 --- a/Alc/dsound.c +++ b/Alc/dsound.c @@ -461,6 +461,8 @@ static ALCboolean DSoundResetPlayback(ALCdevice *device) if(SUCCEEDED(hr)) { + device->TimeRes = (ALuint64)device->UpdateSize * 1000000000 / + device->Frequency; device->Format = format; SetDefaultWFXChannelOrder(device); pData->thread = StartThread(DSoundProc, device); @@ -108,6 +108,9 @@ static ALCboolean null_reset_playback(ALCdevice *device) } SetDefaultWFXChannelOrder(device); + device->TimeRes = (ALuint64)device->UpdateSize * 1000000000 / + device->Frequency; + data->thread = StartThread(NullProc, device); if(data->thread == NULL) { @@ -268,6 +268,8 @@ static ALCboolean oss_reset_playback(ALCdevice *device) device->Frequency = ossSpeed; device->UpdateSize = info.fragsize / frameSize; device->NumUpdates = info.fragments + 1; + device->TimeRes = (ALuint64)device->UpdateSize * 1000000000 / + device->Frequency; data->data_size = device->UpdateSize * frameSize; data->mix_data = calloc(1, data->data_size); diff --git a/Alc/portaudio.c b/Alc/portaudio.c index 94eca19e..062c403a 100644 --- a/Alc/portaudio.c +++ b/Alc/portaudio.c @@ -250,6 +250,8 @@ static ALCboolean pa_reset_playback(ALCdevice *device) streamInfo = pPa_GetStreamInfo(data->stream); device->Frequency = streamInfo->sampleRate; device->UpdateSize = data->update_size; + device->TimeRes = (ALuint64)device->UpdateSize * 1000000000 / + device->Frequency; err = pPa_StartStream(data->stream); if(err != paNoError) diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c index 2769fcd9..9355cc36 100644 --- a/Alc/pulseaudio.c +++ b/Alc/pulseaudio.c @@ -938,6 +938,9 @@ static ALCboolean pulse_reset_playback(ALCdevice *device) //{{{ ppa_stream_set_moved_callback(data->stream, stream_device_callback, device); ppa_stream_set_write_callback(data->stream, stream_write_callback, device); + device->TimeRes = (ALuint64)device->UpdateSize * 1000000000 / + device->Frequency; + data->thread = StartThread(PulseProc, device); if(!data->thread) { diff --git a/Alc/solaris.c b/Alc/solaris.c index cff744ae..4fbb1942 100644 --- a/Alc/solaris.c +++ b/Alc/solaris.c @@ -193,6 +193,8 @@ static ALCboolean solaris_reset_playback(ALCdevice *device) device->Frequency = info.play.sample_rate; device->UpdateSize = (info.play.buffer_size/device->NumUpdates) + 1; + device->TimeRes = (ALuint64)device->UpdateSize * 1000000000 / + device->Frequency; data->data_size = device->UpdateSize * frameSize; data->mix_data = calloc(1, data->data_size); @@ -273,6 +273,8 @@ static ALCboolean wave_reset_playback(ALCdevice *device) return ALC_FALSE; } + device->TimeRes = (ALuint64)device->UpdateSize * 1000000000 / + device->Frequency; SetDefaultWFXChannelOrder(device); data->thread = StartThread(WaveProc, device); |