SDL: audio: Add channel convert filter _after_ choosing an SIMD version.

From 5a0c8198634ad1670f8d003e4f7f8a87cc3c6411 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Tue, 19 Jul 2022 22:03:02 -0400
Subject: [PATCH] audio: Add channel convert filter _after_ choosing an SIMD
 version.

---
 src/audio/SDL_audiocvt.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c
index 1117420e935..0c8757e5567 100644
--- a/src/audio/SDL_audiocvt.c
+++ b/src/audio/SDL_audiocvt.c
@@ -1983,10 +1983,6 @@ SDL_BuildAudioCVT(SDL_AudioCVT * cvt,
         /* All combinations of supported channel counts should have been handled by now, but let's be defensive */
         return SDL_SetError("Invalid channel combination");
     } else if (channel_converter != NULL) {
-        if (SDL_AddAudioCVTFilter(cvt, channel_converter) < 0) {
-            return -1;
-        }
-
         /* swap in some SIMD versions for a few of these. */
         if (channel_converter == SDL_Convert51ToStereo) {
             SDL_AudioFilter filter = NULL;
@@ -2010,6 +2006,10 @@ SDL_BuildAudioCVT(SDL_AudioCVT * cvt,
             if (filter) { channel_converter = filter; }
         }
 
+        if (SDL_AddAudioCVTFilter(cvt, channel_converter) < 0) {
+            return -1;
+        }
+
         if (src_channels < dst_channels) {
             cvt->len_mult = ((cvt->len_mult * dst_channels) + (src_channels-1)) / src_channels;
         }