Commit 541075c3 authored by Jörg Höhle's avatar Jörg Höhle Committed by Alexandre Julliard

mmdevapi: After GetBuffer, refuse Reset, but Start/Stop is ok.

parent 64c1f477
...@@ -1753,6 +1753,11 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface) ...@@ -1753,6 +1753,11 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
return AUDCLNT_E_NOT_STOPPED; return AUDCLNT_E_NOT_STOPPED;
} }
if(This->buf_state != NOT_LOCKED){
LeaveCriticalSection(&This->lock);
return AUDCLNT_E_BUFFER_OPERATION_PENDING;
}
This->held_frames = 0; This->held_frames = 0;
This->written_frames = 0; This->written_frames = 0;
This->lcl_offs_frames = 0; This->lcl_offs_frames = 0;
......
...@@ -1391,6 +1391,11 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface) ...@@ -1391,6 +1391,11 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
return AUDCLNT_E_NOT_STOPPED; return AUDCLNT_E_NOT_STOPPED;
} }
if(This->getbuf_last){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_BUFFER_OPERATION_PENDING;
}
This->written_frames = 0; This->written_frames = 0;
hr = AudioClock_GetPosition_nolock(This, &This->last_time, NULL, TRUE); hr = AudioClock_GetPosition_nolock(This, &This->last_time, NULL, TRUE);
......
...@@ -1379,6 +1379,11 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface) ...@@ -1379,6 +1379,11 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
return AUDCLNT_E_NOT_STOPPED; return AUDCLNT_E_NOT_STOPPED;
} }
if(This->buf_state != NOT_LOCKED){
LeaveCriticalSection(&This->lock);
return AUDCLNT_E_BUFFER_OPERATION_PENDING;
}
This->written_frames = 0; This->written_frames = 0;
This->inbuf_frames = 0; This->inbuf_frames = 0;
This->held_frames = 0; This->held_frames = 0;
......
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