# HG changeset patch # User Ryan C. Gordon # Date 1001318122 0 # Node ID 6df2f69e037eea1783c1fd6a401e6e64c2b65d44 # Parent f3f8e2a0fe76b81ad536a0854094dd388052356c Fixes by Torbj�rn...now the thing actually works! :) See the CHANGELOG entry for 09242001 for an explanation of what the problem was. diff -r f3f8e2a0fe76 -r 6df2f69e037e decoders/mp3.c --- a/decoders/mp3.c Sat Sep 22 16:36:09 2001 +0000 +++ b/decoders/mp3.c Mon Sep 24 07:55:22 2001 +0000 @@ -173,6 +173,11 @@ SMPEG_loop(smpeg, 0); SMPEG_wantedSpec(smpeg, &spec); + /* + * One of the MP3:s I tried wouldn't work unless I added this line + * to tell SMPEG that yes, it may have the spec it wants. + */ + SMPEG_actualSpec(smpeg, &spec); sample->actual.format = spec.format; sample->actual.rate = spec.freq; sample->actual.channels = spec.channels; @@ -197,6 +202,11 @@ Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque; SMPEG *smpeg = (SMPEG *) internal->decoder_private; + /* + * We have to clear the buffer because apparently SMPEG_playAudio() + * will mix the decoded audio with whatever's already in it. Nasty. + */ + memset(internal->buffer, 0, internal->buffer_size); retval = SMPEG_playAudio(smpeg, internal->buffer, internal->buffer_size); if (retval < internal->buffer_size) {