[PATCH] dsound: Clear the temporary mixing buffer after allocation.

Andrew Eikum aeikum at codeweavers.com
Mon Feb 6 08:48:51 CST 2017


Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>

On Sat, Feb 04, 2017 at 11:10:54AM -0700, Erich E. Hoover wrote:
> I spotted this while looking into something else.  When the temporary
> mixing buffer is allocated or reallocated we don't currently get a
> completely zeroed buffer for surround-sound down-mixing, this patch
> fixes it so that the entire buffer is always zeroed.

> From 91a4c25cd8d1f37c9cfe5861b78c1e89fb93126a Mon Sep 17 00:00:00 2001
> From: "Erich E. Hoover" <erich.e.hoover at wine-staging.com>
> Date: Mon, 19 Dec 2016 14:17:23 -0700
> Subject: dsound: Clear the temporary mixing buffer after allocation.
> 
> Signed-off-by: Erich E. Hoover <erich.e.hoover at wine-staging.com>
> ---
>  dlls/dsound/mixer.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c
> index 309c338..2550753 100644
> --- a/dlls/dsound/mixer.c
> +++ b/dlls/dsound/mixer.c
> @@ -428,6 +428,8 @@ static void DSOUND_MixToTemporary(IDirectSoundBufferImpl *dsb, DWORD frames)
>  		else
>  			dsb->device->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, size_bytes);
>  	}
> +	if(dsb->put_aux == putieee32_sum)
> +		memset(dsb->device->tmp_buffer, 0, dsb->device->tmp_buffer_len);
>  
>  	cp_fields(dsb, frames, &dsb->freqAccNum);
>  
> @@ -506,9 +508,6 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, float *mix_buffer,
>  
>  	/* Resample buffer to temporary buffer specifically allocated for this purpose, if needed */
>  	oldpos = dsb->sec_mixpos;
> -
> -	if(dsb->put_aux == putieee32_sum)
> -		memset(dsb->device->tmp_buffer, 0, dsb->device->tmp_buffer_len);
>  	DSOUND_MixToTemporary(dsb, frames);
>  	ibuf = dsb->device->tmp_buffer;
>  
> -- 
> 2.7.4
> 

> 




More information about the wine-patches mailing list