From 2c6a9c5194d883a84c0f61fad1f4c4ada09e08b4 Mon Sep 17 00:00:00 2001 From: pionere Date: Wed, 16 Mar 2022 09:36:43 +0100 Subject: [PATCH] minor optimization (SDL_audiocvt.c) --- src/audio/SDL_audiocvt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index 9ed15b413..bd49ab008 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -1278,7 +1278,10 @@ SDL_BuildAudioCVT(SDL_AudioCVT * cvt, } /* just a byteswap needed? */ - if ((src_fmt & ~SDL_AUDIO_MASK_ENDIAN) == (dst_fmt & ~SDL_AUDIO_MASK_ENDIAN) && SDL_AUDIO_BITSIZE(dst_fmt) > 8) { + if ((src_fmt & ~SDL_AUDIO_MASK_ENDIAN) == (dst_fmt & ~SDL_AUDIO_MASK_ENDIAN)) { + if (SDL_AUDIO_BITSIZE(dst_fmt) == 8) { + return 0; + } if (SDL_AddAudioCVTFilter(cvt, SDL_Convert_Byteswap) < 0) { return -1; }