Skip to content

Commit a5d3a99

Browse files
alexbatalovicculus
authored andcommitted
Fix wrong read position when decoding whole file
1 parent 46a7702 commit a5d3a99

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/SDL_mixer.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,10 @@ static void *DecodeWholeFile(MIX_Audio *audio, SDL_IOStream *io, size_t *decoded
938938
const MIX_Decoder *decoder = audio->decoder;
939939
void *track_userdata = NULL;
940940
if (decoder->init_track(audio->decoder_userdata, io, &audio->spec, audio->props, &track_userdata)) {
941-
while (decoder->decode(track_userdata, stream)) {
942-
// spin.
941+
if (decoder->seek(track_userdata, 0)) {
942+
while (decoder->decode(track_userdata, stream)) {
943+
// spin.
944+
}
943945
}
944946
decoder->quit_track(track_userdata);
945947

0 commit comments

Comments
 (0)