Browse Source

Fix two audio bugs

louyihua 8 years ago
parent
commit
45fef8a855
2 changed files with 2 additions and 2 deletions
  1. 1 1
      audio.c
  2. 1 1
      libmad/music_mad.c

+ 1 - 1
audio.c

@@ -492,7 +492,7 @@ AUDIO_PlaySound(
    SDL_mutexP(gAudioDevice.mtx);
    if (gAudioDevice.pSoundPlayer)
    {
-      gAudioDevice.pSoundPlayer->Play(gAudioDevice.pSoundPlayer, iSoundNum, FALSE, 0.0f);
+      gAudioDevice.pSoundPlayer->Play(gAudioDevice.pSoundPlayer, abs(iSoundNum), FALSE, 0.0f);
    }
    SDL_mutexV(gAudioDevice.mtx);
 }

+ 1 - 1
libmad/music_mad.c

@@ -342,7 +342,7 @@ mad_getSamples(mad_data *mp3_mad, Uint8 *stream, int len) {
               }
 			  src_samples -= to_write;
               while (resampler_get_sample_count(mp3_mad->resampler[i]) > 0) {
-                *dst = SDL_SwapLE16(resampler_get_and_remove_sample(mp3_mad->resampler[i]));
+                *dst = resampler_get_and_remove_sample(mp3_mad->resampler[i]);
 				dst += mp3_mad->mixer.channels; dst_samples++;
               }
             }