wineoss: Move reset 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
dca18a115b
commit
d0089b85c5
|
@ -977,38 +977,17 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient3 *iface)
|
|||
static HRESULT WINAPI AudioClient_Reset(IAudioClient3 *iface)
|
||||
{
|
||||
ACImpl *This = impl_from_IAudioClient3(iface);
|
||||
struct oss_stream *stream = This->stream;
|
||||
struct reset_params params;
|
||||
|
||||
TRACE("(%p)\n", This);
|
||||
|
||||
if(!This->stream)
|
||||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
|
||||
oss_lock(stream);
|
||||
params.stream = This->stream;
|
||||
OSS_CALL(reset, ¶ms);
|
||||
|
||||
if(stream->playing){
|
||||
oss_unlock(stream);
|
||||
return AUDCLNT_E_NOT_STOPPED;
|
||||
}
|
||||
|
||||
if(stream->getbuf_last){
|
||||
oss_unlock(stream);
|
||||
return AUDCLNT_E_BUFFER_OPERATION_PENDING;
|
||||
}
|
||||
|
||||
if(stream->flow == eRender){
|
||||
stream->written_frames = 0;
|
||||
stream->last_pos_frames = 0;
|
||||
}else{
|
||||
stream->written_frames += stream->held_frames;
|
||||
}
|
||||
stream->held_frames = 0;
|
||||
stream->lcl_offs_frames = 0;
|
||||
stream->in_oss_frames = 0;
|
||||
|
||||
oss_unlock(stream);
|
||||
|
||||
return S_OK;
|
||||
return params.result;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient3 *iface,
|
||||
|
|
|
@ -661,6 +661,32 @@ static NTSTATUS stop(void *args)
|
|||
return oss_unlock_result(stream, ¶ms->result, S_OK);
|
||||
}
|
||||
|
||||
static NTSTATUS reset(void *args)
|
||||
{
|
||||
struct reset_params *params = args;
|
||||
struct oss_stream *stream = params->stream;
|
||||
|
||||
oss_lock(stream);
|
||||
|
||||
if(stream->playing)
|
||||
return oss_unlock_result(stream, ¶ms->result, AUDCLNT_E_NOT_STOPPED);
|
||||
|
||||
if(stream->getbuf_last)
|
||||
return oss_unlock_result(stream, ¶ms->result, AUDCLNT_E_BUFFER_OPERATION_PENDING);
|
||||
|
||||
if(stream->flow == eRender){
|
||||
stream->written_frames = 0;
|
||||
stream->last_pos_frames = 0;
|
||||
}else{
|
||||
stream->written_frames += stream->held_frames;
|
||||
}
|
||||
stream->held_frames = 0;
|
||||
stream->lcl_offs_frames = 0;
|
||||
stream->in_oss_frames = 0;
|
||||
|
||||
return oss_unlock_result(stream, ¶ms->result, S_OK);
|
||||
}
|
||||
|
||||
static void silence_buffer(struct oss_stream *stream, BYTE *buffer, UINT32 frames)
|
||||
{
|
||||
WAVEFORMATEXTENSIBLE *fmtex = (WAVEFORMATEXTENSIBLE*)stream->fmt;
|
||||
|
@ -1025,6 +1051,7 @@ unixlib_entry_t __wine_unix_call_funcs[] =
|
|||
release_stream,
|
||||
start,
|
||||
stop,
|
||||
reset,
|
||||
timer_loop,
|
||||
is_format_supported,
|
||||
get_mix_format,
|
||||
|
|
|
@ -102,6 +102,12 @@ struct stop_params
|
|||
HRESULT result;
|
||||
};
|
||||
|
||||
struct reset_params
|
||||
{
|
||||
struct oss_stream *stream;
|
||||
HRESULT result;
|
||||
};
|
||||
|
||||
struct timer_loop_params
|
||||
{
|
||||
struct oss_stream *stream;
|
||||
|
@ -154,6 +160,7 @@ enum oss_funcs
|
|||
oss_release_stream,
|
||||
oss_start,
|
||||
oss_stop,
|
||||
oss_reset,
|
||||
oss_timer_loop,
|
||||
oss_is_format_supported,
|
||||
oss_get_mix_format,
|
||||
|
|
Loading…
Reference in New Issue