wineoss: Move is_started 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:
Huw Davies 2022-04-15 21:40:42 +01:00 committed by Alexandre Julliard
parent 9fa0544819
commit 4b469fe157
3 changed files with 22 additions and 4 deletions

View File

@ -1596,6 +1596,7 @@ static HRESULT WINAPI AudioSessionControl_GetState(IAudioSessionControl2 *iface,
AudioSessionState *state)
{
AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface);
struct is_started_params params;
ACImpl *client;
TRACE("(%p)->(%p)\n", This, state);
@ -1612,14 +1613,13 @@ static HRESULT WINAPI AudioSessionControl_GetState(IAudioSessionControl2 *iface,
}
LIST_FOR_EACH_ENTRY(client, &This->session->clients, ACImpl, entry){
oss_lock(client->stream);
if(client->stream->playing){
params.stream = client->stream;
OSS_CALL(is_started, &params);
if(params.result == S_OK){
*state = AudioSessionStateActive;
oss_unlock(client->stream);
LeaveCriticalSection(&g_sessions_lock);
return S_OK;
}
oss_unlock(client->stream);
}
LeaveCriticalSection(&g_sessions_lock);

View File

@ -1336,6 +1336,16 @@ static NTSTATUS set_event_handle(void *args)
return oss_unlock_result(stream, &params->result, S_OK);
}
static NTSTATUS is_started(void *args)
{
struct is_started_params *params = args;
struct oss_stream *stream = params->stream;
oss_lock(stream);
return oss_unlock_result(stream, &params->result, stream->playing ? S_OK : S_FALSE);
}
unixlib_entry_t __wine_unix_call_funcs[] =
{
test_connect,
@ -1359,4 +1369,5 @@ unixlib_entry_t __wine_unix_call_funcs[] =
get_frequency,
get_position,
set_event_handle,
is_started,
};

View File

@ -215,6 +215,12 @@ struct set_event_handle_params
HRESULT result;
};
struct is_started_params
{
struct oss_stream *stream;
HRESULT result;
};
enum oss_funcs
{
oss_test_connect,
@ -238,6 +244,7 @@ enum oss_funcs
oss_get_frequency,
oss_get_position,
oss_set_event_handle,
oss_is_started,
};
extern unixlib_handle_t oss_handle;