[PATCH 1/2] xaudio2: Rewrite to use FAudio

Alexandre Julliard julliard at winehq.org
Tue Feb 19 04:53:23 CST 2019


elee at codeweavers.com writes:

> @@ -1276,20 +274,6 @@ START_TEST(xaudio2)
>          hr = IXAudio27_QueryInterface(xa27, &IID_IXAudio28, (void**) &xa);
>          ok(hr != S_OK, "QueryInterface with IID_IXAudio28 on IXAudio27 object returned success. Expected to fail\n");
>  
> -        hr = IXAudio27_Initialize(xa27, 0, XAUDIO2_ANY_PROCESSOR);
> -        ok(hr == S_OK, "Initialize failed: %08x\n", hr);
> -
> -        has_devices = test_DeviceDetails(xa27);
> -        if(has_devices){
> -            test_simple_streaming((IXAudio2*)xa27);
> -            test_buffer_callbacks((IXAudio2*)xa27);
> -            test_looping((IXAudio2*)xa27);
> -            test_submix((IXAudio2*)xa27);
> -            test_flush((IXAudio2*)xa27);
> -            test_setchannelvolumes((IXAudio2*)xa27);
> -        }else
> -            skip("No audio devices available\n");
> -

Why are you removing all these tests?

> diff --git a/dlls/xaudio2_7/xaudio_allocator.c b/dlls/xaudio2_7/xaudio_allocator.c
> new file mode 100644
> index 0000000000..41be48a80f
> --- /dev/null
> +++ b/dlls/xaudio2_7/xaudio_allocator.c
> @@ -0,0 +1,41 @@
> +/*
> + * Copyright (c) 2018 Ethan Lee for CodeWeavers
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
> + */
> +
> +#include "config.h"
> +
> +#include <stdarg.h>
> +
> +#define NONAMELESSUNION
> +#define COBJMACROS
> +
> +#include "ole2.h"
> +
> +void* XAudio_Internal_Malloc(size_t size)
> +{
> +    return CoTaskMemAlloc(size);
> +}
> +
> +void XAudio_Internal_Free(void* ptr)
> +{
> +    return CoTaskMemFree(ptr);
> +}
> +
> +void* XAudio_Internal_Realloc(void* ptr, size_t size)
> +{
> +    return CoTaskMemRealloc(ptr, size);
> +}

It doesn't seem necessary to create a separate file just for this. I
know you intended to reuse it for xactengine but you might as well
duplicate these few lines.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list