From f312a8ee8284d25378e730440d5ad40109b4b593 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 15 Dec 2021 13:30:30 -0800
Subject: [PATCH] Minor cleanup
---
src/codecs/music_wav.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/src/codecs/music_wav.c b/src/codecs/music_wav.c
index da7ca1e5..472ab63d 100644
--- a/src/codecs/music_wav.c
+++ b/src/codecs/music_wav.c
@@ -91,9 +91,10 @@ typedef struct {
Uint32 byterate; /* Average bytes per second */
Uint16 blockalign; /* Bytes per sample block */
Uint16 bitspersample; /* One of 8, 12, 16, or 4 for ADPCM */
-} WaveFMTHeader;
+} WaveFMT;
typedef struct {
+ WaveFMT format;
Uint16 cbSize;
union {
Uint16 validbitspersample; /* bits of precision */
@@ -106,12 +107,7 @@ typedef struct {
Uint16 sub_data2;
Uint16 sub_data3;
Uint8 sub_data[8];
-} WaveFMTex;
-
-typedef struct {
- WaveFMTHeader format;
- WaveFMTex formatEx;
-} _WaveFMT;
+} WaveFMTEx;
typedef struct {
Uint32 identifier;
@@ -639,7 +635,7 @@ static void WAV_Delete(void *context)
static SDL_bool ParseFMT(WAV_Music *wave, Uint32 chunk_length)
{
SDL_AudioSpec *spec = &wave->spec;
- _WaveFMT fmt;
+ WaveFMTEx fmt;
int bits;
if (chunk_length < sizeof(fmt.format)) {
@@ -665,7 +661,7 @@ static SDL_bool ParseFMT(WAV_Music *wave, Uint32 chunk_length)
Mix_SetError("Wave format chunk too small");
return SDL_FALSE;
}
- wave->encoding = (Uint16)SDL_SwapLE32(fmt.formatEx.subencoding);
+ wave->encoding = (Uint16)SDL_SwapLE32(fmt.subencoding);
}
/* Decode the audio data format */