Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed early termination playing MP3 files with libmad
  • Loading branch information
slouken committed Oct 21, 2017
1 parent c830429 commit 4b6c333
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions music_mad.c
Expand Up @@ -350,19 +350,16 @@ static int MAD_GetSome(void *context, void *data, int bytes, SDL_bool *done)
if (!decode_frame(music)) {
return -1;
}
} else {
} else if (music->status & MS_input_eof) {
int play_count = -1;

if (music->status & MS_decode_error) {
return -1;
}

if (music->play_count > 0) {
play_count = (music->play_count - 1);
}
if (MAD_Play(music, play_count) < 0) {
return -1;
}
} else if (music->status & MS_decode_error) {
return -1;
}
return 0;
}
Expand Down

0 comments on commit 4b6c333

Please sign in to comment.