mmdevapi: Unlock buffer in case of ReleaseBuffer error.
This commit is contained in:
parent
55efce6c9c
commit
8379680095
|
@ -2097,8 +2097,9 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer(
|
|||
written = alsa_write_best_effort(This->pcm_handle, buffer,
|
||||
written_frames, This);
|
||||
if(written < 0){
|
||||
This->buf_state = NOT_LOCKED;
|
||||
LeaveCriticalSection(&This->lock);
|
||||
WARN("write failed: %ld (%s)\n", written, snd_strerror(written));
|
||||
ERR("write failed: %ld (%s)\n", written, snd_strerror(written));
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
|
|
@ -1731,8 +1731,9 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer(
|
|||
written_frames * This->fmt->nBlockAlign);
|
||||
if(w_bytes < 0){
|
||||
if(errno != EAGAIN){
|
||||
This->buf_state = NOT_LOCKED;
|
||||
LeaveCriticalSection(&This->lock);
|
||||
WARN("write failed: %d (%s)\n", errno, strerror(errno));
|
||||
ERR("write failed: %d (%s)\n", errno, strerror(errno));
|
||||
return E_FAIL;
|
||||
}else /* OSS buffer full */
|
||||
w_bytes = 0;
|
||||
|
|
Loading…
Reference in New Issue