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

This commit is contained in:
Jörg Höhle 2011-08-10 18:07:51 +02:00 committed by Alexandre Julliard
parent 64c1f4778c
commit 541075c3db
3 changed files with 15 additions and 0 deletions

View File

@ -1753,6 +1753,11 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
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->written_frames = 0;
This->lcl_offs_frames = 0;

View File

@ -1391,6 +1391,11 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
return AUDCLNT_E_NOT_STOPPED;
}
if(This->getbuf_last){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_BUFFER_OPERATION_PENDING;
}
This->written_frames = 0;
hr = AudioClock_GetPosition_nolock(This, &This->last_time, NULL, TRUE);

View File

@ -1379,6 +1379,11 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
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->inbuf_frames = 0;
This->held_frames = 0;