winecoreaudio: 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
46f5083e23
commit
b884ca314d
|
@ -1527,6 +1527,20 @@ static NTSTATUS get_position(void *args)
|
|||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static NTSTATUS get_frequency(void *args)
|
||||
{
|
||||
struct get_frequency_params *params = args;
|
||||
struct coreaudio_stream *stream = params->stream;
|
||||
|
||||
if(stream->share == AUDCLNT_SHAREMODE_SHARED)
|
||||
*params->freq = (UINT64)stream->fmt->nSamplesPerSec * stream->fmt->nBlockAlign;
|
||||
else
|
||||
*params->freq = stream->fmt->nSamplesPerSec;
|
||||
|
||||
params->result = S_OK;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
unixlib_entry_t __wine_unix_call_funcs[] =
|
||||
{
|
||||
get_endpoint_ids,
|
||||
|
@ -1546,4 +1560,5 @@ unixlib_entry_t __wine_unix_call_funcs[] =
|
|||
get_current_padding,
|
||||
get_next_packet_size,
|
||||
get_position,
|
||||
get_frequency,
|
||||
};
|
||||
|
|
|
@ -1458,15 +1458,14 @@ static ULONG WINAPI AudioClock_Release(IAudioClock *iface)
|
|||
static HRESULT WINAPI AudioClock_GetFrequency(IAudioClock *iface, UINT64 *freq)
|
||||
{
|
||||
ACImpl *This = impl_from_IAudioClock(iface);
|
||||
struct get_frequency_params params;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, freq);
|
||||
|
||||
if(This->stream->share == AUDCLNT_SHAREMODE_SHARED)
|
||||
*freq = (UINT64)This->stream->fmt->nSamplesPerSec * This->stream->fmt->nBlockAlign;
|
||||
else
|
||||
*freq = This->stream->fmt->nSamplesPerSec;
|
||||
|
||||
return S_OK;
|
||||
params.stream = This->stream;
|
||||
params.freq = freq;
|
||||
UNIX_CALL(get_frequency, ¶ms);
|
||||
return params.result;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI AudioClock_GetPosition(IAudioClock *iface, UINT64 *pos,
|
||||
|
|
|
@ -181,6 +181,13 @@ struct get_position_params
|
|||
UINT64 *qpctime;
|
||||
};
|
||||
|
||||
struct get_frequency_params
|
||||
{
|
||||
struct coreaudio_stream *stream;
|
||||
HRESULT result;
|
||||
UINT64 *freq;
|
||||
};
|
||||
|
||||
enum unix_funcs
|
||||
{
|
||||
unix_get_endpoint_ids,
|
||||
|
@ -200,6 +207,7 @@ enum unix_funcs
|
|||
unix_get_current_padding,
|
||||
unix_get_next_packet_size,
|
||||
unix_get_position,
|
||||
unix_get_frequency,
|
||||
};
|
||||
|
||||
extern unixlib_handle_t coreaudio_handle;
|
||||
|
|
Loading…
Reference in New Issue