Maarten Lankhorst : winealsa: Remove forceformat and 2 orphan LeaveCriticalSection.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Sep 10 10:17:54 CDT 2007


Module: wine
Branch: master
Commit: 985df9cdf0dc1561cebfa27a01bd7f98d0c7d746
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=985df9cdf0dc1561cebfa27a01bd7f98d0c7d746

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Wed Sep  5 10:56:59 2007 +0200

winealsa: Remove forceformat and 2 orphan LeaveCriticalSection.

---

 dlls/winealsa.drv/dsoutput.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/dlls/winealsa.drv/dsoutput.c b/dlls/winealsa.drv/dsoutput.c
index c1cd039..d51e39a 100644
--- a/dlls/winealsa.drv/dsoutput.c
+++ b/dlls/winealsa.drv/dsoutput.c
@@ -73,7 +73,6 @@ struct IDsDriverImpl
     /* IDsDriverImpl fields */
     IDsDriverBufferImpl* primary;
     UINT wDevID;
-    DWORD forceformat;
 };
 
 struct IDsDriverBufferImpl
@@ -396,8 +395,6 @@ static HRESULT SetFormat(IDsDriverBufferImpl *This, LPWAVEFORMATEX pwfx)
     {
         if (errno != EBUSY || !This->pcm)
         {
-            /* **** */
-            LeaveCriticalSection(&This->pcm_crst);
             WARN("Cannot open sound device: %s\n", snd_strerror(err));
             return DSERR_GENERIC;
         }
@@ -407,8 +404,6 @@ static HRESULT SetFormat(IDsDriverBufferImpl *This, LPWAVEFORMATEX pwfx)
         err = snd_pcm_open(&pcm, WOutDev[This->drv->wDevID].pcmname, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
         if (err < 0)
         {
-            /* **** */
-            LeaveCriticalSection(&This->pcm_crst);
             WARN("Cannot open sound device: %s\n", snd_strerror(err));
             return DSERR_BUFFERLOST;
         }
@@ -433,12 +428,7 @@ static HRESULT SetFormat(IDsDriverBufferImpl *This, LPWAVEFORMATEX pwfx)
     err = snd_pcm_hw_params_set_rate_near(pcm, hw_params, &rate, NULL);
     if (err < 0) { rate = pwfx->nSamplesPerSec; WARN("Could not set rate\n"); goto err; }
 
-    if (!ALSA_NearMatch(rate, pwfx->nSamplesPerSec) && (This->drv->forceformat++))
-    {
-        WARN("Could not set exact rate %d, instead %d, bombing out\n", pwfx->nSamplesPerSec, rate);
-        goto err;
-    }
-    else if (!ALSA_NearMatch(rate, pwfx->nSamplesPerSec))
+    if (!ALSA_NearMatch(rate, pwfx->nSamplesPerSec))
     {
         WARN("Could not set sound rate to %d, but instead to %d\n", pwfx->nSamplesPerSec, rate);
         pwfx->nSamplesPerSec = rate;
@@ -496,7 +486,6 @@ static HRESULT WINAPI IDsDriverBufferImpl_SetFormat(PIDSDRIVERBUFFER iface, LPWA
 
     /* **** */
     EnterCriticalSection(&This->pcm_crst);
-    This->drv->forceformat = FALSE;
     hr = SetFormat(This, pwfx);
     /* **** */
     LeaveCriticalSection(&This->pcm_crst);




More information about the wine-cvs mailing list