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

Ethan Lee elee at codeweavers.com
Tue Feb 19 08:25:12 CST 2019


The tests were moved/ported to FAudio's repository:

https://github.com/FNA-XNA/FAudio/blob/master/tests/xaudio2.c

The only tests that remain are the ones that Wine specifically cares about, mainly the COM and XAPO tests.

The XAudio_Allocator is also shared by XAPOFX and XAudio2FX, so it’s already used multiple times excluding XACTEngine. I can still duplicate it however many times, but it introduces a risk of allocators getting mixed, resulting in CustomAllocatorEXT violations.

-Ethan

> On Feb 19, 2019, at 5:53 AM, Alexandre Julliard <julliard at winehq.org> wrote:
> 
> 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