https://git.reactos.org/?p=reactos.git;a=commitdiff;h=183566ee584efbe6377c79e68bfe24b2d1f940ae

commit 183566ee584efbe6377c79e68bfe24b2d1f940ae
Author:     Oleg Dubinskiy <[email protected]>
AuthorDate: Sun Aug 15 17:06:56 2021 +0300
Commit:     Stanislav Motylkov <[email protected]>
CommitDate: Sat Sep 11 01:58:03 2021 +0300

    [DSOUND] Don't force status to failure by default in 
primarybuffer_SetFormat (#3911)
    
    Don't force HRESULT status to DSERR_BUFFERLOST by default in 
primarybuffer_SetFormat function.
    Assign to it S_OK instead, as done in current Wine:
    
https://source.winehq.org/git/wine.git/blob/a8583acae9548e6340d8400ec7710136cd061ab2:/dlls/dsound/primary.c#l440
    
    That variable is already set to failure in other appropriate place, when 
this is indeed needed:
    
https://git.reactos.org/?p=reactos.git;a=blob;h=b04a526929e4e817ff63aa652530e5901a3253a6;f=dll/directx/wine/dsound/primary.c#l511
    
    The assigned failure status caused executing failure handling code even 
when the fail actually didn't happen.
    In particular, DSOUND_ReopenDevice failed on waveOutOpen call when calling 
this was not needed.
    After my changes, it's called only when needed, i. e., only when the actual 
failure happens
    Otherwise, if all goes good, that code is not called, so the data is 
transfered successfully and the function is working correctly.
    It fixes non-working playback in QMMP 0.11.1 (via DirectSound ouput plugin) 
and AIMP 3.10 and newer versions.
    Also it improves the DirectSound test results from MS DxDiag: now all 4 
available tests are passing successfully, instead of only 2.
    Other dsound issues also might be fixed as well.
    
    CORE-10907 CORE-14783
---
 dll/directx/wine/dsound/primary.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dll/directx/wine/dsound/primary.c 
b/dll/directx/wine/dsound/primary.c
index b04a526929e..9f8ecf8e593 100644
--- a/dll/directx/wine/dsound/primary.c
+++ b/dll/directx/wine/dsound/primary.c
@@ -459,7 +459,7 @@ LPWAVEFORMATEX DSOUND_CopyFormat(LPCWAVEFORMATEX wfex)
 
 HRESULT primarybuffer_SetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX 
wfex)
 {
-       HRESULT err = DSERR_BUFFERLOST;
+       HRESULT err = S_OK;
        int i;
        DWORD nSamplesPerSec, bpp, chans;
        LPWAVEFORMATEX oldpwfx;

Reply via email to