Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package FAudio for openSUSE:Factory checked 
in at 2021-09-17 23:26:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/FAudio (Old)
 and      /work/SRC/openSUSE:Factory/.FAudio.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "FAudio"

Fri Sep 17 23:26:00 2021 rev:15 rq:919669 version:21.09

Changes:
--------
--- /work/SRC/openSUSE:Factory/FAudio/FAudio.changes    2021-07-13 
22:38:00.789849268 +0200
+++ /work/SRC/openSUSE:Factory/.FAudio.new.1899/FAudio.changes  2021-09-17 
23:26:22.417258763 +0200
@@ -1,0 +2,10 @@
+Thu Sep 16 17:48:28 UTC 2021 - Aaron Stern <[email protected]>
+
+- update to 21.09:
+  * FACT: Fix a crash from an uninitialized pointer when a WaveBank does not 
have a name 
+    table.
+  * platform_sdl2: When querying the default device, ignore audio devices with 
way too many 
+    channels.
+  * platform_win32: Minor Win32 buildfixes
+
+-------------------------------------------------------------------

Old:
----
  FAudio-21.07.tar.gz

New:
----
  FAudio-21.09.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ FAudio.spec ++++++
--- /var/tmp/diff_new_pack.R50acF/_old  2021-09-17 23:26:22.901259195 +0200
+++ /var/tmp/diff_new_pack.R50acF/_new  2021-09-17 23:26:22.901259195 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           FAudio
-Version:        21.07
+Version:        21.09
 Release:        0
 Summary:        A reimplementation of the XNA Game Studio libraries
 License:        Zlib
@@ -87,8 +87,8 @@
 %{_libdir}/libFAudio.so
 %dir %{_libdir}/cmake
 %dir %{_libdir}/cmake/FAudio
-%{_libdir}/cmake/FAudio/FAudio-config.cmake
 %{_libdir}/cmake/FAudio/FAudio-targets.cmake
+%{_libdir}/cmake/FAudio/FAudioConfig.cmake
 %{_libdir}/cmake/FAudio/FAudio-targets-release.cmake
 %{_libdir}/pkgconfig/FAudio.pc
 

++++++ FAudio-21.07.tar.gz -> FAudio-21.09.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FAudio-21.07/CMakeLists.txt 
new/FAudio-21.09/CMakeLists.txt
--- old/FAudio-21.07/CMakeLists.txt     2021-07-01 17:44:51.000000000 +0200
+++ new/FAudio-21.09/CMakeLists.txt     2021-09-01 17:38:17.000000000 +0200
@@ -31,7 +31,7 @@
 # Version
 SET(LIB_MAJOR_VERSION "0")
 SET(LIB_MINOR_VERSION "21")
-SET(LIB_REVISION "07")
+SET(LIB_REVISION "09")
 SET(LIB_VERSION "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_REVISION}")
 
 # Build Type
@@ -479,11 +479,11 @@
 include(CMakePackageConfigHelpers)
 configure_package_config_file(
        cmake/config.cmake.in
-       ${CMAKE_CURRENT_BINARY_DIR}/generated/${PROJECT_NAME}-config.cmake
+       ${CMAKE_CURRENT_BINARY_DIR}/generated/${PROJECT_NAME}Config.cmake
        INSTALL_DESTINATION ${FAudio_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
 )
 install(
-       FILES ${CMAKE_CURRENT_BINARY_DIR}/generated/${PROJECT_NAME}-config.cmake
+       FILES ${CMAKE_CURRENT_BINARY_DIR}/generated/${PROJECT_NAME}Config.cmake
        DESTINATION ${FAudio_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
 )
 install(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FAudio-21.07/csharp/FAudio.cs 
new/FAudio-21.09/csharp/FAudio.cs
--- old/FAudio-21.07/csharp/FAudio.cs   2021-07-01 17:44:51.000000000 +0200
+++ new/FAudio-21.09/csharp/FAudio.cs   2021-09-01 17:38:17.000000000 +0200
@@ -79,7 +79,7 @@
 
        public const uint FAUDIO_ABI_VERSION =           0;
        public const uint FAUDIO_MAJOR_VERSION =        21;
-       public const uint FAUDIO_MINOR_VERSION =         7;
+       public const uint FAUDIO_MINOR_VERSION =         9;
        public const uint FAUDIO_PATCH_VERSION =         0;
 
        public const uint FAUDIO_COMPILED_VERSION = (
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FAudio-21.07/include/FAudio.h 
new/FAudio-21.09/include/FAudio.h
--- old/FAudio-21.07/include/FAudio.h   2021-07-01 17:44:51.000000000 +0200
+++ new/FAudio-21.09/include/FAudio.h   2021-09-01 17:38:17.000000000 +0200
@@ -485,7 +485,7 @@
 
 #define FAUDIO_ABI_VERSION      0
 #define FAUDIO_MAJOR_VERSION   21
-#define FAUDIO_MINOR_VERSION    7
+#define FAUDIO_MINOR_VERSION    9
 #define FAUDIO_PATCH_VERSION    0
 
 #define FAUDIO_COMPILED_VERSION ( \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FAudio-21.07/src/FACT.c new/FAudio-21.09/src/FACT.c
--- old/FAudio-21.07/src/FACT.c 2021-07-01 17:44:51.000000000 +0200
+++ new/FAudio-21.09/src/FACT.c 2021-09-01 17:38:17.000000000 +0200
@@ -167,14 +167,82 @@
 
        FAudio_PlatformLockMutex(pEngine->apiLock);
 
-       /* Parse the file */
-       parseRet = FACT_INTERNAL_ParseAudioEngine(pEngine, pParams);
-       if (parseRet != 0)
+       if (!pParams->pGlobalSettingsBuffer || 
pParams->globalSettingsBufferSize == 0)
        {
-               FAudio_PlatformUnlockMutex(pEngine->apiLock);
-               return parseRet;
+               /* No file? Just go with a safe default. (Also why are you 
using XACT) */
+               pEngine->categoryCount = 3;
+               pEngine->variableCount = 0;
+               pEngine->rpcCount = 0;
+               pEngine->dspPresetCount = 0;
+               pEngine->dspParameterCount = 0;
+
+               pEngine->categories = (FACTAudioCategory*) pEngine->pMalloc(
+                       sizeof(FACTAudioCategory) * pEngine->categoryCount
+               );
+               pEngine->categoryNames = (char**) pEngine->pMalloc(
+                       sizeof(char*) * pEngine->categoryCount
+               );
+
+               pEngine->categoryNames[0] = pEngine->pMalloc(7);
+               FAudio_strlcpy(pEngine->categoryNames[0], "Global", 7);
+               pEngine->categories[0].instanceLimit = 255;
+               pEngine->categories[0].fadeInMS = 0;
+               pEngine->categories[0].fadeOutMS = 0;
+               pEngine->categories[0].maxInstanceBehavior = 0;
+               pEngine->categories[0].parentCategory = -1;
+               pEngine->categories[0].volume = 1.0f;
+               pEngine->categories[0].visibility = 1;
+               pEngine->categories[0].instanceCount = 0;
+               pEngine->categories[0].currentVolume = 1.0f;
+
+               pEngine->categoryNames[1] = pEngine->pMalloc(8);
+               FAudio_strlcpy(pEngine->categoryNames[1], "Default", 8);
+               pEngine->categories[1].instanceLimit = 255;
+               pEngine->categories[1].fadeInMS = 0;
+               pEngine->categories[1].fadeOutMS = 0;
+               pEngine->categories[1].maxInstanceBehavior = 0;
+               pEngine->categories[1].parentCategory = 0;
+               pEngine->categories[1].volume = 1.0f;
+               pEngine->categories[1].visibility = 1;
+               pEngine->categories[1].instanceCount = 0;
+               pEngine->categories[1].currentVolume = 1.0f;
+
+               pEngine->categoryNames[2] = pEngine->pMalloc(6);
+               FAudio_strlcpy(pEngine->categoryNames[2], "Music", 6);
+               pEngine->categories[2].instanceLimit = 255;
+               pEngine->categories[2].fadeInMS = 0;
+               pEngine->categories[2].fadeOutMS = 0;
+               pEngine->categories[2].maxInstanceBehavior = 0;
+               pEngine->categories[2].parentCategory = 0;
+               pEngine->categories[2].volume = 1.0f;
+               pEngine->categories[2].visibility = 1;
+               pEngine->categories[2].instanceCount = 0;
+               pEngine->categories[2].currentVolume = 1.0f;
+
+               pEngine->variables = NULL;
+               pEngine->variableNames = NULL;
+               pEngine->globalVariableValues = NULL;
+               pEngine->rpcs = NULL;
+               pEngine->dspPresets = NULL;
+       }
+       else
+       {
+               /* Parse the file */
+               parseRet = FACT_INTERNAL_ParseAudioEngine(pEngine, pParams);
+               if (parseRet != 0)
+               {
+                       FAudio_PlatformUnlockMutex(pEngine->apiLock);
+                       return parseRet;
+               }
        }
 
+       /* Peristent Notifications */
+       pEngine->notifications = 0;
+       pEngine->cue_context = NULL;
+       pEngine->sb_context = NULL;
+       pEngine->wb_context = NULL;
+       pEngine->wave_context = NULL;
+
        /* Assign the callbacks */
        pEngine->notificationCallback = pParams->fnNotificationCallback;
        pEngine->pReadFile = pParams->fileIOCallbacks.readFileCallback;
@@ -1545,6 +1613,11 @@
        }
        FAudio_PlatformDestroyMutex(pWaveBank->waveLock);
 
+       if (pWaveBank->waveBankNames != NULL)
+       {
+               pWaveBank->parentEngine->pFree(pWaveBank->waveBankNames);
+       }
+
        mutex = pWaveBank->parentEngine->apiLock;
        pWaveBank->parentEngine->pFree(pWaveBank);
        FAudio_PlatformUnlockMutex(mutex);
@@ -1600,8 +1673,26 @@
        FACTWaveBank *pWaveBank,
        const char *szFriendlyName
 ) {
-       FAudio_assert(0 && "WaveBank name tables are not supported!");
-       return 0;
+       uint16_t i;
+       char *curName;
+       if (pWaveBank == NULL || pWaveBank->waveBankNames == NULL)
+       {
+               return FACTINDEX_INVALID;
+       }
+
+       FAudio_PlatformLockMutex(pWaveBank->parentEngine->apiLock);
+       curName = pWaveBank->waveBankNames;
+       for (i = 0; i < pWaveBank->entryCount; i += 1, curName += 64)
+       {
+               if (FAudio_strncmp(szFriendlyName, curName, 64) == 0)
+               {
+                       
FAudio_PlatformUnlockMutex(pWaveBank->parentEngine->apiLock);
+                       return i;
+               }
+       }
+       FAudio_PlatformUnlockMutex(pWaveBank->parentEngine->apiLock);
+
+       return FACTINDEX_INVALID;
 }
 
 uint32_t FACTWaveBank_GetWaveProperties(
@@ -1619,11 +1710,21 @@
 
        entry = &pWaveBank->entries[nWaveIndex];
 
-       /* FIXME: Name tables! -flibit */
-       FAudio_zero(
-               pWaveProperties->friendlyName,
-               sizeof(pWaveProperties->friendlyName)
-       );
+       if (pWaveBank->waveBankNames)
+       {
+               FAudio_memcpy(
+                       pWaveProperties->friendlyName,
+                       &pWaveBank->waveBankNames[nWaveIndex * 64],
+                       sizeof(pWaveProperties->friendlyName)
+               );
+       }
+       else
+       {
+               FAudio_zero(
+                       pWaveProperties->friendlyName,
+                       sizeof(pWaveProperties->friendlyName)
+               );
+       }
 
        pWaveProperties->format = entry->Format;
        pWaveProperties->durationInSamples = entry->PlayRegion.dwLength;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FAudio-21.07/src/FACT_internal.c 
new/FAudio-21.09/src/FACT_internal.c
--- old/FAudio-21.07/src/FACT_internal.c        2021-07-01 17:44:51.000000000 
+0200
+++ new/FAudio-21.09/src/FACT_internal.c        2021-09-01 17:38:17.000000000 
+0200
@@ -2066,12 +2066,6 @@
        uint8_t *ptr = (uint8_t*) pParams->pGlobalSettingsBuffer;
        uint8_t *start = ptr;
 
-       /* FIXME: Should be recorded so we can return the correct error */
-       if (!pParams->pGlobalSettingsBuffer || 
pParams->globalSettingsBufferSize == 0)
-       {
-               return 0;
-       }
-
        magic = read_u32(&ptr, 0);
        se = magic == 0x58475346; /* Swap Endian */
        if (magic != 0x46534758 && magic != 0x58475346) /* 'XGSF' */
@@ -2281,13 +2275,6 @@
                ptr += memsize;
        }
 
-       /* Peristent Notifications */
-       pEngine->notifications = 0;
-       pEngine->cue_context = NULL;
-       pEngine->sb_context = NULL;
-       pEngine->wb_context = NULL;
-       pEngine->wave_context = NULL;
-
        /* Store this pointer in case we're asked to free it */
        if (pParams->globalSettingsFlags & FACT_FLAG_MANAGEDATA)
        {
@@ -3319,12 +3306,17 @@
                wb->seekTables = NULL;
        }
 
-       /* TODO: WaveBank Entry Names
+       /* WaveBank Entry Names */
        if (wbinfo.dwFlags & FACT_WAVEBANK_FLAGS_ENTRYNAMES)
        {
                
SEEKSET(header.Segments[FACT_WAVEBANK_SEGIDX_ENTRYNAMES].dwOffset)
+               wb->waveBankNames = (char*) pEngine->pMalloc(64 * 
wbinfo.dwEntryCount);
+               READ(wb->waveBankNames, 64 * wbinfo.dwEntryCount);
+       }
+       else
+       {
+               wb->waveBankNames = NULL;
        }
-       */
 
        /* Add to the Engine WaveBank list */
        LinkedList_AddEntry(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FAudio-21.07/src/FACT_internal.h 
new/FAudio-21.09/src/FACT_internal.h
--- old/FAudio-21.07/src/FACT_internal.h        2021-07-01 17:44:51.000000000 
+0200
+++ new/FAudio-21.09/src/FACT_internal.h        2021-09-01 17:38:17.000000000 
+0200
@@ -490,6 +490,7 @@
        FACTWaveBankEntry *entries;
        uint32_t *entryRefs;
        FACTSeekTable *seekTables;
+       char *waveBankNames;
 
        /* I/O information */
        uint32_t packetSize;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FAudio-21.07/src/FAudioFX_reverb.c 
new/FAudio-21.09/src/FAudioFX_reverb.c
--- old/FAudio-21.07/src/FAudioFX_reverb.c      2021-07-01 17:44:51.000000000 
+0200
+++ new/FAudio-21.09/src/FAudioFX_reverb.c      2021-09-01 17:38:17.000000000 
+0200
@@ -477,13 +477,66 @@
        7.73f
 };
 
-static const float STEREO_SPREAD[4] =
+typedef enum FAudio_ChannelPositionFlags
 {
-       0.0f,
-       0.5216f,
-       0.0f,
-       0.5216f
-};
+       Position_Left = 0x1,
+       Position_Right = 0x2,
+       Position_Center = 0x4,
+       Position_Rear = 0x8,
+} FAudio_ChannelPositionFlags;
+
+static FAudio_ChannelPositionFlags FAudio_GetChannelPositionFlags(int32_t 
total_channels, int32_t channel)
+{
+       switch (total_channels)
+       {
+               case 1:
+                       return Position_Center;
+
+               case 2:
+                       return (channel == 0) ? Position_Left : Position_Right;
+
+               case 4:
+                       switch (channel)
+                       {
+                               case 0:
+                                       return Position_Left;
+                               case 1:
+                                       return Position_Right;
+                               case 2:
+                                       return Position_Left | Position_Rear;
+                               case 3:
+                                       return Position_Right | Position_Rear;
+                       }
+
+               case 5:
+                       switch (channel)
+                       {
+                               case 0:
+                                       return Position_Left;
+                               case 1:
+                                       return Position_Right;
+                               case 2:
+                                       return Position_Center;
+                               case 3:
+                                       return Position_Left | Position_Rear;
+                               case 4:
+                                       return Position_Right | Position_Rear;
+                       }
+
+               default:
+                       FAudio_assert(0 && "Unsupported channel count");
+                       break;
+       }
+
+       /* shouldn't happen, but default to left speaker */
+       return Position_Left;
+}
+
+float FAudio_GetStereoSpreadDelayMS(int32_t total_channels, int32_t channel)
+{
+       FAudio_ChannelPositionFlags flags = 
FAudio_GetChannelPositionFlags(total_channels, channel);
+       return (flags & Position_Right) ? 0.5216f : 0.0f;
+}
 
 typedef struct DspReverbChannel
 {
@@ -503,7 +556,7 @@
        int32_t in_channels;
        int32_t out_channels;
        int32_t reverb_channels;
-       DspReverbChannel channel[4];
+       DspReverbChannel channel[5];
 
        float early_gain;
        float reverb_gain;
@@ -521,7 +574,7 @@
 ) {
        int32_t i, c;
 
-       FAudio_assert(in_channels == 1 || in_channels == 2);
+       FAudio_assert(in_channels == 1 || in_channels == 2 || in_channels == 6);
        FAudio_assert(out_channels == 1 || out_channels == 2 || out_channels == 
6);
 
        FAudio_zero(reverb, sizeof(DspReverb));
@@ -538,7 +591,14 @@
                );
        }
 
-       reverb->reverb_channels = (out_channels == 6) ? 4 : out_channels;
+       if (out_channels == 6)
+       {
+               reverb->reverb_channels = (in_channels == 6) ? 5 : 4;
+       }
+       else
+       {
+               reverb->reverb_channels = out_channels;
+       }
 
        for (c = 0; c < reverb->reverb_channels; c += 1)
        {
@@ -554,7 +614,7 @@
                        DspCombShelving_Initialize(
                                &reverb->channel[c].lpf_comb[i],
                                sampleRate,
-                               COMB_DELAYS[i] + STEREO_SPREAD[c],
+                               COMB_DELAYS[i] + 
FAudio_GetStereoSpreadDelayMS(reverb->reverb_channels, c),
                                500,
                                500,
                                -6,
@@ -569,7 +629,7 @@
                        DspAllPass_Initialize(
                                &reverb->channel[c].apf_out[i],
                                sampleRate,
-                               APF_OUT_DELAYS[i] + STEREO_SPREAD[c],
+                               APF_OUT_DELAYS[i] + 
FAudio_GetStereoSpreadDelayMS(reverb->reverb_channels, c),
                                0.5f,
                                pMalloc
                        );
@@ -634,13 +694,6 @@
        FAudioFXReverbParameters *params
 ) {
        float early_diffusion, late_diffusion;
-       float channel_delay[4] =
-       {
-               0.0f,
-               0.0f,
-               params->RearDelay,
-               params->RearDelay
-       };
        DspCombShelving *comb;
        int32_t i, c;
 
@@ -662,9 +715,14 @@
        /* Reverberation */
        for (c = 0; c < reverb->reverb_channels; c += 1)
        {
+               float channel_delay =
+                       
(FAudio_GetChannelPositionFlags(reverb->reverb_channels, c) & Position_Rear) ?
+                       params->RearDelay :
+                       0.0f;
+
                DspDelay_Change(
                        &reverb->channel[c].reverb_delay,
-                       (float) params->ReverbDelay + channel_delay[c]
+                       (float) params->ReverbDelay + channel_delay
                );
 
                for (i = 0; i < REVERB_COUNT_COMB; i += 1)
@@ -674,7 +732,7 @@
                        /* Set decay time of comb filter */
                        DspDelay_Change(
                                &comb->comb_delay,
-                               COMB_DELAYS[i] + STEREO_SPREAD[c]
+                               COMB_DELAYS[i] + 
FAudio_GetStereoSpreadDelayMS(reverb->reverb_channels, c)
                        );
                        comb->comb_feedback_gain = DspComb_FeedbackFromRT60(
                                &comb->comb_delay,
@@ -709,11 +767,14 @@
 
        for (c = 0; c < reverb->reverb_channels; c += 1)
        {
+               FAudio_ChannelPositionFlags position = 
FAudio_GetChannelPositionFlags(reverb->reverb_channels, c);
+               float gain;
+
                for (i = 0; i < REVERB_COUNT_APF_OUT; i += 1)
                {
                        DspAllPass_Change(
                                &reverb->channel[c].apf_out[i],
-                               APF_OUT_DELAYS[i] + STEREO_SPREAD[c],
+                               APF_OUT_DELAYS[i] + 
FAudio_GetStereoSpreadDelayMS(reverb->reverb_channels, c),
                                late_diffusion
                        );
                }
@@ -726,24 +787,39 @@
                        params->RoomFilterMain + params->RoomFilterHF
                );
 
-               reverb->channel[c].gain = 1.5f - (
-                       ((c % 2 == 0 ?
-                               params->PositionMatrixLeft :
-                               params->PositionMatrixRight
-                       ) / 27.0f) * 0.5f
-               );
-               if (c >= 2)
+               if (position & Position_Left)
+               {
+                       gain = params->PositionMatrixLeft;
+               }
+               else if (position & Position_Right)
+               {
+                       gain = params->PositionMatrixRight;
+               }
+               else /*if (position & Position_Center) */
+               {
+                       gain = (params->PositionMatrixLeft + 
params->PositionMatrixRight) / 2.0f;
+               }
+               reverb->channel[c].gain = 1.5f - (gain / 27.0f) * 0.5f;
+
+               if (position & Position_Rear)
                {
                        /* Rear-channel Attenuation */
                        reverb->channel[c].gain *= 0.75f;
                }
 
-               reverb->channel[c].early_gain = 1.2f - (
-                       ((c % 2 == 0 ?
-                               params->PositionLeft :
-                               params->PositionRight
-                       ) / 6.0f) * 0.2f
-               );
+               if (position & Position_Left)
+               {
+                       gain = params->PositionLeft;
+               }
+               else if (position & Position_Right)
+               {
+                       gain = params->PositionRight;
+               }
+               else /*if (position & Position_Center) */
+               {
+                       gain = (params->PositionLeft + params->PositionRight) / 
2.0f;
+               }
+               reverb->channel[c].early_gain = 1.2f - (gain / 6.0f) * 0.2f;
                reverb->channel[c].early_gain = (
                        reverb->channel[c].early_gain *
                        reverb->early_gain
@@ -1015,6 +1091,52 @@
        return squared_sum;
 }
 
+static inline float DspReverb_INTERNAL_Process_5p1_to_5p1(
+       DspReverb *reverb,
+       float *restrict samples_in,
+       float *restrict samples_out,
+       size_t sample_count
+) {
+       const float *in_end = samples_in + sample_count;
+       float in, in_ratio, early, late[5];
+       float squared_sum = 0;
+       int32_t c;
+
+       while (samples_in < in_end)
+       {
+               /* Input - Combine non-LFE channels into 1 */
+               in = (samples_in[0] + samples_in[1] + samples_in[2] +
+                               samples_in[4] + samples_in[5]) / 5.0f;
+               in_ratio = in * reverb->dry_ratio;
+
+               /* Early Reflections */
+               early = DspReverb_INTERNAL_ProcessEarly(reverb, in);
+
+               /* Reverberation with Wet/Dry Mix */
+               for (c = 0; c < 5; c += 1)
+               {
+                       late[c] = (DspReverb_INTERNAL_ProcessChannel(
+                               reverb,
+                               &reverb->channel[c],
+                               early
+                       ) * reverb->wet_ratio) + in_ratio;
+                       squared_sum += late[c] * late[c];
+               }
+
+               /* Output */
+               *samples_out++ = late[0];       /* Front Left */
+               *samples_out++ = late[1];       /* Front Right */
+               *samples_out++ = late[2];       /* Center */
+               *samples_out++ = samples_in[3]; /* LFE, pass through */
+               *samples_out++ = late[3];       /* Rear Left */
+               *samples_out++ = late[4];       /* Rear Right */
+
+               samples_in += 6;
+       }
+
+       return squared_sum;
+}
+
 #undef OUTPUT_SAMPLE
 
 /* Reverb FAPO Implementation */
@@ -1148,7 +1270,8 @@
        else if (pOutputFormat->nChannels == 6)
        {
                if (    pRequestedInputFormat->nChannels != 1 &&
-                       pRequestedInputFormat->nChannels != 2   )
+                       pRequestedInputFormat->nChannels != 2 &&
+                       pRequestedInputFormat->nChannels != 6   )
                {
                        SET_SUPPORTED_FIELD(nChannels, 1);
                }
@@ -1200,6 +1323,13 @@
                        SET_SUPPORTED_FIELD(nChannels, pInputFormat->nChannels);
                }
        }
+       else if (pInputFormat->nChannels == 6)
+       {
+               if (pRequestedOutputFormat->nChannels != 6)
+               {
+                       SET_SUPPORTED_FIELD(nChannels, pInputFormat->nChannels);
+               }
+       }
        else
        {
                SET_SUPPORTED_FIELD(nChannels, 1);
@@ -1252,7 +1382,9 @@
                         pOutputLockedParameters->pFormat->nChannels == 6)) ||
                (pInputLockedParameters->pFormat->nChannels == 2 &&
                        (pOutputLockedParameters->pFormat->nChannels == 2 ||
-                        pOutputLockedParameters->pFormat->nChannels == 6))))
+                        pOutputLockedParameters->pFormat->nChannels == 6)) ||
+               (pInputLockedParameters->pFormat->nChannels == 6 &&
+                       pOutputLockedParameters->pFormat->nChannels == 6)))
        {
                return FAPO_E_FORMAT_UNSUPPORTED;
        }
@@ -1295,7 +1427,7 @@
                return;
        }
        
-       /* 1 -> 1 or 2 -> 2 */
+       /* equal channel count */
        if (fapo->inBlockAlign == fapo->outBlockAlign)
        {
                FAudio_memcpy(
@@ -1421,10 +1553,14 @@
                        {
                                total = PROCESS(1, 5p1);
                        }
-                       else
+                       else if (fapo->reverb.in_channels == 2)
                        {
                                total = PROCESS(2, 5p1);
                        }
+                       else /* 5.1 */
+                       {
+                               total = PROCESS(5p1, 5p1);
+                       }
                        break;
        }
        #undef PROCESS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FAudio-21.07/src/FAudio_gstreamer.c 
new/FAudio-21.09/src/FAudio_gstreamer.c
--- old/FAudio-21.07/src/FAudio_gstreamer.c     2021-07-01 17:44:51.000000000 
+0200
+++ new/FAudio-21.09/src/FAudio_gstreamer.c     2021-09-01 17:38:17.000000000 
+0200
@@ -53,8 +53,6 @@
        ((sample) * voice->src.format->nChannels * sizeof(float))
 #define SIZE_FROM_SRC(sample) \
        ((sample) * voice->src.format->nChannels * 
(voice->src.format->wBitsPerSample / 8))
-#define SIZE_FROM_DST(sample) \
-       ((sample) * voice->src.format->nChannels * sizeof(float))
 #define SAMPLES_FROM_SRC(len) \
        ((len) / voice->src.format->nChannels / 
(voice->src.format->wBitsPerSample / 8))
 #define SAMPLES_FROM_DST(len) \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FAudio-21.07/src/FAudio_internal.h 
new/FAudio-21.09/src/FAudio_internal.h
--- old/FAudio-21.07/src/FAudio_internal.h      2021-07-01 17:44:51.000000000 
+0200
+++ new/FAudio-21.09/src/FAudio_internal.h      2021-09-01 17:38:17.000000000 
+0200
@@ -32,6 +32,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <malloc.h>
 #include <math.h>
 #include <assert.h>
 #include <inttypes.h>
@@ -52,6 +53,7 @@
 
 #define FAudio_strlen(ptr) strlen(ptr)
 #define FAudio_strcmp(str1, str2) strcmp(str1, str2)
+#define FAudio_strncmp(str1, str2, size) strncmp(str1, str2, size)
 #define FAudio_strlcpy(ptr1, ptr2, size) lstrcpynA(ptr1, ptr2, size)
 
 #define FAudio_pow(x, y) pow(x, y)
@@ -125,6 +127,7 @@
 
 #define FAudio_strlen(ptr) SDL_strlen(ptr)
 #define FAudio_strcmp(str1, str2) SDL_strcmp(str1, str2)
+#define FAudio_strncmp(str1, str2, size) SDL_strncmp(str1, str1, size)
 #define FAudio_strlcpy(ptr1, ptr2, size) SDL_strlcpy(ptr1, ptr2, size)
 
 #define FAudio_pow(x, y) SDL_pow(x, y)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/FAudio-21.07/src/FAudio_platform_sdl2.c 
new/FAudio-21.09/src/FAudio_platform_sdl2.c
--- old/FAudio-21.07/src/FAudio_platform_sdl2.c 2021-07-01 17:44:51.000000000 
+0200
+++ new/FAudio-21.09/src/FAudio_platform_sdl2.c 2021-09-01 17:38:17.000000000 
+0200
@@ -338,7 +338,8 @@
                        for (i = 0; i < devcount; i += 1)
                        {
                                SDL_GetAudioDeviceSpec(i, 0, &spec);
-                               if (spec.channels > channels)
+                               if (    (spec.channels > channels) &&
+                                       (spec.channels <= 8)    )
                                {
                                        channels = spec.channels;
                                        if (setRate)

Reply via email to