From 83796800959794b98bb1dfd4090bbf3a04627605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20H=C3=B6hle?= Date: Mon, 12 Sep 2011 07:12:10 +0200 Subject: [PATCH] mmdevapi: Unlock buffer in case of ReleaseBuffer error. --- dlls/winealsa.drv/mmdevdrv.c | 3 ++- dlls/wineoss.drv/mmdevdrv.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 15146f59476..81181039b44 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -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; } diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index 33438e4954c..b7e3bbfec63 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -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;