Patch for SDL_mixer and MP3 playing

SMPEG rewind in music_internal_position apparently stop SMPEG from playing!

so here’s my patch:

Index: music.c===================================================================
RCS file: /home/sdlweb/libsdl.org/cvs/SDL_mixer/music.c,v
retrieving revision 1.45
diff -u -b -B -r1.45 music.c
— music.c 2002/05/16 18:28:06 1.45
+++ music.c 2002/05/19 03:09:36
@@ -648,7 +648,7 @@
case MUS_MP3:
SMPEG_enableaudio(music->data.mp3,1);
SMPEG_enablevideo(music->data.mp3,0);

SMPEG_play(music->data.mp3);
  • /SMPEG_play(music->data.mp3);/
    break;
    #endif
    default:
    @@ -665,7 +665,10 @@

      retval = -1;
    

    }
    } else {

  •   music_internal_position(0.0);
    
  •   if ( music_internal_position(0.0) < 0 ) {
    
  •   	Mix_SetError("Position not implemented for music type");
    
  •   	retval = -1;
    
  •   }
      }
    
    }

@@ -738,6 +741,8 @@
case MUS_MP3:
if ( position == 0.0 ) {

SMPEG_rewind(music_playing->data.mp3);
  •   if(music_playing)
    
  •   	SMPEG_play(music_playing->data.mp3);
      } else {
    

    SMPEG_skip(music_playing->data.mp3, position);
    }


-==-
Jon Atkins
http://jcatki.2y.net/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed…
Name: music.c.diff
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020518/83f31e33/attachment.txt

ok, now we can’t rewind MP3’s anymore (in the cvs)
this simple patch lets that work again…

Index: music.c===================================================================
RCS file: /home/sdlweb/libsdl.org/cvs/SDL_mixer/music.c,v
retrieving revision 1.47
diff -u -b -B -r1.47 music.c
— music.c 2002/05/19 20:47:22 1.47
+++ music.c 2002/05/19 21:54:53
@@ -752,6 +752,11 @@
if ( position > 0.0 ) {
SMPEG_skip(music_playing->data.mp3, position);
}

  •           else
    
  •           {
    
  •                   SMPEG_rewind(music_playing->data.mp3);
    
  •                   SMPEG_play(music_playing->data.mp3);
    
  •           }
               break;
    
    #endif
    default:


-==-
Jon Atkins
http://jcatki.2y.net/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed…
Name: music.c.diff
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020519/b71334e9/attachment.asc