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

mmdevapi: Unlock buffer in case of ReleaseBuffer error.

parent 55efce6c
......@@ -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;
......
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