mmdevapi: After GetBuffer, refuse Reset, but Start/Stop is ok.
This commit is contained in:
parent
64c1f4778c
commit
541075c3db
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue