Module: wine Branch: master Commit: ce0a985f1bc887c4a606697f635d1716232855ac URL: https://gitlab.winehq.org/wine/wine/-/commit/ce0a985f1bc887c4a606697f635d171...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Aug 3 17:13:51 2022 +0200
faudio: Import upstream release 22.08.
---
libs/faudio/include/FAudio.h | 2 +- libs/faudio/src/FAudio_platform_win32.c | 2 +- libs/faudio/src/matrix_defaults.inl | 62 +++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 2 deletions(-)
diff --git a/libs/faudio/include/FAudio.h b/libs/faudio/include/FAudio.h index f9dce8dfc16..88d5e996cbf 100644 --- a/libs/faudio/include/FAudio.h +++ b/libs/faudio/include/FAudio.h @@ -485,7 +485,7 @@ extern FAudioGUID DATAFORMAT_SUBTYPE_IEEE_FLOAT;
#define FAUDIO_ABI_VERSION 0 #define FAUDIO_MAJOR_VERSION 22 -#define FAUDIO_MINOR_VERSION 7 +#define FAUDIO_MINOR_VERSION 8 #define FAUDIO_PATCH_VERSION 0
#define FAUDIO_COMPILED_VERSION ( \ diff --git a/libs/faudio/src/FAudio_platform_win32.c b/libs/faudio/src/FAudio_platform_win32.c index 29944edcfed..8ed9cde1c7d 100644 --- a/libs/faudio/src/FAudio_platform_win32.c +++ b/libs/faudio/src/FAudio_platform_win32.c @@ -582,7 +582,7 @@ FAudioThread FAudio_PlatformCreateThread( void FAudio_PlatformWaitThread(FAudioThread thread, int32_t *retval) { WaitForSingleObject(thread, INFINITE); - GetExitCodeThread(thread, (DWORD *)retval); + if (retval != NULL) GetExitCodeThread(thread, (DWORD *)retval); }
void FAudio_PlatformThreadPriority(FAudioThreadPriority priority) diff --git a/libs/faudio/src/matrix_defaults.inl b/libs/faudio/src/matrix_defaults.inl index 2262a6a0744..6f540f289d3 100644 --- a/libs/faudio/src/matrix_defaults.inl +++ b/libs/faudio/src/matrix_defaults.inl @@ -1,6 +1,68 @@ /* This was generated by making 8 sources and 8 submixes, then assigning each * submix to each voice and dumping the output matrix. Terrible, but it worked! */ +/* +int main(int argc, char **argv) +{ + CoInitialize(NULL); + + IXAudio2 *engine; + XAudio2Create(&engine); + + IXAudio2MasteringVoice *master; + engine->CreateMasteringVoice(&master); + + FILE *fileOut = fopen("matrix_defaults.inl", "w"); + for (int srcChans = 1; srcChans < 9; srcChans += 1) + { + fprintf(fileOut, "{\n"); + for (int dstChans = 1; dstChans < 9; dstChans += 1) + { + IXAudio2SubmixVoice *submix; + engine->CreateSubmixVoice(&submix, dstChans, 48000); + + XAUDIO2_SEND_DESCRIPTOR sendDesc; + sendDesc.Flags = 0; + sendDesc.pOutputVoice = submix; + + XAUDIO2_VOICE_SENDS sends; + sends.SendCount = 1; + sends.pSends = &sendDesc; + + WAVEFORMATEX fmt; + fmt.wFormatTag = 1; + fmt.nChannels = srcChans; + fmt.nSamplesPerSec = 48000; + fmt.wBitsPerSample = 16; + fmt.nBlockAlign = srcChans * (fmt.wBitsPerSample / 8); + fmt.nAvgBytesPerSec = fmt.nBlockAlign * fmt.nSamplesPerSec; + fmt.cbSize = 0; + + IXAudio2SourceVoice *source; + engine->CreateSourceVoice(&source, &fmt, 0, 2.0f, NULL, &sends); + + float matrix[8 * 8]; + source->GetOutputMatrix(submix, srcChans, dstChans, matrix); + fprintf(fileOut, "\t{ "); + for (int i = 0; i < srcChans * dstChans; i += 1) + { + fprintf(fileOut, "%.9f%s ", matrix[i], (i == ((srcChans * dstChans) - 1)) ? "" : ","); + } + fprintf(fileOut, "}%s\n", (dstChans == 8) ? "" : ","); + + source->DestroyVoice(); + submix->DestroyVoice(); + } + fprintf(fileOut, "}%s\n", (srcChans == 8) ? "" : ","); + } + fclose(fileOut); + + master->DestroyVoice(); + engine->Release(); + CoUninitialize(); + return 0; +} +*/ { /* 1 x 1 */ { 1.000000000f },