Skip to content

Commit cf4befd

Browse files
committed
audio: If predecoding, remove i/o clamps that applied to compressed data.
1 parent a5d3a99 commit cf4befd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/SDL_mixer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,8 @@ MIX_Audio *MIX_LoadAudioWithProperties(SDL_PropertiesID props) // lets you spec
10611061
decoder = audio->decoder = &MIX_Decoder_RAW;
10621062
audio_userdata = audio->decoder_userdata = NULL; // no audio_userdata state in the RAW decoder (so we can cheat here and not do a full init_audio().)
10631063
audio->duration_frames = audio->precachelen / SDL_AUDIO_FRAMESIZE(audio->spec);
1064+
audio->clamp_offset = -1; // we're raw data now, any existing clamp is just nonsense now.
1065+
audio->clamp_length = -1;
10641066
} else if (!ondemand) { // precache the audio data, so all decoding happens from a single buffer in RAM shared between tracks.
10651067
if ((audio->precache = SDL_LoadFile_IO(io, &audio->precachelen, false)) == NULL) {
10661068
goto failed;

0 commit comments

Comments
 (0)