winealsa: Move get_frequency to the unixlib.
Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0846197017
commit
a30888693a
|
@ -2094,6 +2094,22 @@ static NTSTATUS get_next_packet_size(void *args)
|
|||
return alsa_unlock_result(stream, ¶ms->result, S_OK);
|
||||
}
|
||||
|
||||
static NTSTATUS get_frequency(void *args)
|
||||
{
|
||||
struct get_frequency_params *params = args;
|
||||
struct alsa_stream *stream = params->stream;
|
||||
UINT64 *freq = params->freq;
|
||||
|
||||
alsa_lock(stream);
|
||||
|
||||
if(stream->share == AUDCLNT_SHAREMODE_SHARED)
|
||||
*freq = (UINT64)stream->fmt->nSamplesPerSec * stream->fmt->nBlockAlign;
|
||||
else
|
||||
*freq = stream->fmt->nSamplesPerSec;
|
||||
|
||||
return alsa_unlock_result(stream, ¶ms->result, S_OK);
|
||||
}
|
||||
|
||||
static NTSTATUS set_event_handle(void *args)
|
||||
{
|
||||
struct set_event_handle_params *params = args;
|
||||
|
@ -2133,5 +2149,6 @@ unixlib_entry_t __wine_unix_call_funcs[] =
|
|||
get_latency,
|
||||
get_current_padding,
|
||||
get_next_packet_size,
|
||||
get_frequency,
|
||||
set_event_handle,
|
||||
};
|
||||
|
|
|
@ -1478,16 +1478,16 @@ static ULONG WINAPI AudioClock_Release(IAudioClock *iface)
|
|||
static HRESULT WINAPI AudioClock_GetFrequency(IAudioClock *iface, UINT64 *freq)
|
||||
{
|
||||
ACImpl *This = impl_from_IAudioClock(iface);
|
||||
struct alsa_stream *stream = This->stream;
|
||||
struct get_frequency_params params;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, freq);
|
||||
|
||||
if(stream->share == AUDCLNT_SHAREMODE_SHARED)
|
||||
*freq = (UINT64)stream->fmt->nSamplesPerSec * stream->fmt->nBlockAlign;
|
||||
else
|
||||
*freq = stream->fmt->nSamplesPerSec;
|
||||
params.stream = This->stream;
|
||||
params.freq = freq;
|
||||
|
||||
return S_OK;
|
||||
ALSA_CALL(get_frequency, ¶ms);
|
||||
|
||||
return params.result;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI AudioClock_GetPosition(IAudioClock *iface, UINT64 *pos,
|
||||
|
|
|
@ -194,6 +194,13 @@ struct get_next_packet_size_params
|
|||
UINT32 *frames;
|
||||
};
|
||||
|
||||
struct get_frequency_params
|
||||
{
|
||||
struct alsa_stream *stream;
|
||||
HRESULT result;
|
||||
UINT64 *freq;
|
||||
};
|
||||
|
||||
struct set_event_handle_params
|
||||
{
|
||||
struct alsa_stream *stream;
|
||||
|
@ -220,6 +227,7 @@ enum alsa_funcs
|
|||
alsa_get_latency,
|
||||
alsa_get_current_padding,
|
||||
alsa_get_next_packet_size,
|
||||
alsa_get_frequency,
|
||||
alsa_set_event_handle,
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue