Commit 4b469fe1 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

wineoss: Move is_started to the unixlib.

parent 9fa05448
......@@ -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);
......
......@@ -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,
};
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment