Fixed various issues with the new SDL_mixer code (thanks Ozkan!)
authorSam Lantinga <slouken@libsdl.org>
Tue, 17 Oct 2017 16:43:23 -0700
changeset 78074df2aa47195
parent 779 a2b494c054d5
child 781 90487b4b7ade
Fixed various issues with the new SDL_mixer code (thanks Ozkan!)
VisualC-WinRT/WinPhone80_VS2012/SDL_mixer-WinPhone80.vcxproj
VisualC-WinRT/WinPhone80_VS2012/SDL_mixer-WinPhone80.vcxproj.filters
configure
configure.in
music.c
     1.1 --- a/VisualC-WinRT/WinPhone80_VS2012/SDL_mixer-WinPhone80.vcxproj	Tue Oct 17 02:54:52 2017 -0700
     1.2 +++ b/VisualC-WinRT/WinPhone80_VS2012/SDL_mixer-WinPhone80.vcxproj	Tue Oct 17 16:43:23 2017 -0700
     1.3 @@ -170,7 +170,7 @@
     1.4      <ClCompile Include="..\..\music_mad.c" />
     1.5      <ClCompile Include="..\..\music_mikmod.c" />
     1.6      <ClCompile Include="..\..\music_ogg.c" />
     1.7 -    <ClCompile Include="..\..\wavestream.c" />
     1.8 +    <ClCompile Include="..\..\music_wav.c" />
     1.9    </ItemGroup>
    1.10    <ItemGroup>
    1.11      <ClInclude Include="..\..\dynamic_flac.h" />
    1.12 @@ -190,7 +190,7 @@
    1.13      <ClInclude Include="..\..\music_mikmod.h" />
    1.14      <ClInclude Include="..\..\music_ogg.h" />
    1.15      <ClInclude Include="..\..\SDL_mixer.h" />
    1.16 -    <ClInclude Include="..\..\wavestream.h" />
    1.17 +    <ClInclude Include="..\..\music_wav.h" />
    1.18    </ItemGroup>
    1.19    <ItemGroup>
    1.20      <ProjectReference Include="..\..\..\SDL\VisualC-WinRT\WinPhone80_VS2012\SDL-WinPhone80.vcxproj">
     2.1 --- a/VisualC-WinRT/WinPhone80_VS2012/SDL_mixer-WinPhone80.vcxproj.filters	Tue Oct 17 02:54:52 2017 -0700
     2.2 +++ b/VisualC-WinRT/WinPhone80_VS2012/SDL_mixer-WinPhone80.vcxproj.filters	Tue Oct 17 16:43:23 2017 -0700
     2.3 @@ -21,7 +21,7 @@
     2.4      <ClCompile Include="..\..\music_mad.c" />
     2.5      <ClCompile Include="..\..\music_mikmod.c" />
     2.6      <ClCompile Include="..\..\music_ogg.c" />
     2.7 -    <ClCompile Include="..\..\wavestream.c" />
     2.8 +    <ClCompile Include="..\..\music_wav.c" />
     2.9    </ItemGroup>
    2.10    <ItemGroup>
    2.11      <ClInclude Include="..\..\dynamic_flac.h" />
    2.12 @@ -41,6 +41,6 @@
    2.13      <ClInclude Include="..\..\music_mikmod.h" />
    2.14      <ClInclude Include="..\..\music_ogg.h" />
    2.15      <ClInclude Include="..\..\SDL_mixer.h" />
    2.16 -    <ClInclude Include="..\..\wavestream.h" />
    2.17 +    <ClInclude Include="..\..\music_wav.h" />
    2.18    </ItemGroup>
    2.19  </Project>
     3.1 --- a/configure	Tue Oct 17 02:54:52 2017 -0700
     3.2 +++ b/configure	Tue Oct 17 16:43:23 2017 -0700
     3.3 @@ -11086,20 +11086,12 @@
     3.4          fi
     3.5          ;;
     3.6      *)
     3.7 -        SOURCES=""
     3.8          EXE=""
     3.9          ;;
    3.10  esac
    3.11  
    3.12  # Standard C sources
    3.13 -SOURCES="$SOURCES \
    3.14 -$srcdir/effect_position.c \
    3.15 -$srcdir/effect_stereoreverse.c \
    3.16 -$srcdir/effects_internal.c \
    3.17 -$srcdir/load_aiff.c \
    3.18 -$srcdir/load_voc.c \
    3.19 -$srcdir/mixer.c \
    3.20 -$srcdir/music.c"
    3.21 +SOURCES=`ls $srcdir/*.c | fgrep -v playwave.c | fgrep -v playmus.c`
    3.22  
    3.23  base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
    3.24  
    3.25 @@ -11722,7 +11714,6 @@
    3.26          enable_music_cmd=no
    3.27      fi
    3.28      if test "x$enable_music_cmd" != xno; then
    3.29 -        SOURCES="$SOURCES $srcdir/music_cmd.c"
    3.30          EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_CMD"
    3.31      fi
    3.32  fi
    3.33 @@ -11735,7 +11726,6 @@
    3.34  fi
    3.35  
    3.36  if test x$enable_music_wave = xyes; then
    3.37 -    SOURCES="$SOURCES $srcdir/wavestream.c"
    3.38      EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_WAV"
    3.39  fi
    3.40  
    3.41 @@ -11944,7 +11934,6 @@
    3.42                  fi
    3.43                  ;;
    3.44          esac
    3.45 -        SOURCES="$SOURCES $srcdir/*_modplug.c"
    3.46          EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MOD_MODPLUG $MODPLUG_CFLAGS"
    3.47          if test x$enable_music_mod_modplug_shared = xyes && test x$modplug_lib != x; then
    3.48              echo "-- dynamic libmodplug -> $modplug_lib"
    3.49 @@ -12076,7 +12065,6 @@
    3.50                  fi
    3.51                  ;;
    3.52          esac
    3.53 -        SOURCES="$SOURCES $srcdir/*_mikmod.c"
    3.54          EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MOD_MIKMOD `$LIBMIKMOD_CONFIG --cflags`"
    3.55          if test x$enable_music_mod_mikmod_shared = xyes && test x$mikmod_lib != x; then
    3.56              echo "-- dynamic libmikmod -> $mikmod_lib"
    3.57 @@ -12227,7 +12215,6 @@
    3.58                      fi
    3.59                      ;;
    3.60              esac
    3.61 -            SOURCES="$SOURCES $srcdir/dynamic_fluidsynth.c $srcdir/fluidsynth.c"
    3.62              EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MID_FLUIDSYNTH"
    3.63              if test x$enable_music_midi_fluidsynth_shared = xyes && test x$fluidsynth_lib != x; then
    3.64                  echo "-- dynamic libfluidsyth -> $fluidsynth_lib"
    3.65 @@ -12337,7 +12324,6 @@
    3.66                      fi
    3.67                      ;;
    3.68              esac
    3.69 -            SOURCES="$SOURCES $srcdir/*_ogg.c"
    3.70              EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_OGG -DOGG_USE_TREMOR"
    3.71              if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
    3.72                  echo "-- dynamic libvorbisidec -> $ogg_lib"
    3.73 @@ -12415,7 +12401,6 @@
    3.74                      fi
    3.75                      ;;
    3.76              esac
    3.77 -            SOURCES="$SOURCES $srcdir/*_ogg.c"
    3.78              EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_OGG"
    3.79              if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
    3.80                  echo "-- dynamic libvorbisfile -> $ogg_lib"
    3.81 @@ -12551,7 +12536,6 @@
    3.82                      fi
    3.83                      ;;
    3.84              esac
    3.85 -            SOURCES="$SOURCES $srcdir/*_flac.c"
    3.86              EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_FLAC"
    3.87              if test x$enable_music_flac_shared = xyes && test x$flac_lib != x; then
    3.88                  echo "-- dynamic libFLAC -> $flac_lib"
    3.89 @@ -12891,7 +12875,6 @@
    3.90      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_libmad" >&5
    3.91  $as_echo "$have_libmad" >&6; }
    3.92      if test x$have_libmad = xyes; then
    3.93 -        SOURCES="$SOURCES $srcdir/music_mad.c"
    3.94          EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MP3_MAD"
    3.95          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmad"
    3.96      else
    3.97 @@ -12934,7 +12917,6 @@
    3.98      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_libmpg123" >&5
    3.99  $as_echo "$have_libmpg123" >&6; }
   3.100      if test x$have_libmpg123 = xyes; then
   3.101 -        SOURCES="$SOURCES $srcdir/music_mpg.c"
   3.102          EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MP3_MPG123"
   3.103          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmpg123"
   3.104      else
   3.105 @@ -12944,7 +12926,7 @@
   3.106  fi
   3.107  
   3.108  if test x$have_smpeg = xyes -o x$have_libmad = xyes -o x$have_libmpg123; then
   3.109 -    SOURCES="$SOURCES $srcdir/load_mp3.c"
   3.110 +    :
   3.111  else
   3.112      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: MP3 support disabled" >&5
   3.113  $as_echo "$as_me: WARNING: MP3 support disabled" >&2;}
     4.1 --- a/configure.in	Tue Oct 17 02:54:52 2017 -0700
     4.2 +++ b/configure.in	Tue Oct 17 16:43:23 2017 -0700
     4.3 @@ -130,20 +130,12 @@
     4.4          fi
     4.5          ;;
     4.6      *)
     4.7 -        SOURCES=""
     4.8          EXE=""
     4.9          ;;
    4.10  esac
    4.11  
    4.12  # Standard C sources
    4.13 -SOURCES="$SOURCES \
    4.14 -$srcdir/effect_position.c \
    4.15 -$srcdir/effect_stereoreverse.c \
    4.16 -$srcdir/effects_internal.c \
    4.17 -$srcdir/load_aiff.c \
    4.18 -$srcdir/load_voc.c \
    4.19 -$srcdir/mixer.c \
    4.20 -$srcdir/music.c"
    4.21 +SOURCES=`ls $srcdir/*.c | fgrep -v playwave.c | fgrep -v playmus.c`
    4.22  
    4.23  dnl set this to use on systems that use lib64 instead of lib
    4.24  base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
    4.25 @@ -229,7 +221,6 @@
    4.26          enable_music_cmd=no
    4.27      fi
    4.28      if test "x$enable_music_cmd" != xno; then
    4.29 -        SOURCES="$SOURCES $srcdir/music_cmd.c"
    4.30          EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_CMD"
    4.31      fi
    4.32  fi
    4.33 @@ -238,7 +229,6 @@
    4.34  AC_HELP_STRING([--enable-music-wave], [enable streaming WAVE music [[default=yes]]]),
    4.35                [], [enable_music_wave=yes])
    4.36  if test x$enable_music_wave = xyes; then
    4.37 -    SOURCES="$SOURCES $srcdir/wavestream.c"
    4.38      EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_WAV"
    4.39  fi
    4.40  
    4.41 @@ -277,7 +267,6 @@
    4.42                  fi
    4.43                  ;;
    4.44          esac
    4.45 -        SOURCES="$SOURCES $srcdir/*_modplug.c"
    4.46          EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MOD_MODPLUG $MODPLUG_CFLAGS"
    4.47          if test x$enable_music_mod_modplug_shared = xyes && test x$modplug_lib != x; then
    4.48              echo "-- dynamic libmodplug -> $modplug_lib"
    4.49 @@ -345,7 +334,6 @@
    4.50                  fi
    4.51                  ;;
    4.52          esac
    4.53 -        SOURCES="$SOURCES $srcdir/*_mikmod.c"
    4.54          EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MOD_MIKMOD `$LIBMIKMOD_CONFIG --cflags`"
    4.55          if test x$enable_music_mod_mikmod_shared = xyes && test x$mikmod_lib != x; then
    4.56              echo "-- dynamic libmikmod -> $mikmod_lib"
    4.57 @@ -430,7 +418,6 @@
    4.58                      fi
    4.59                      ;;
    4.60              esac
    4.61 -            SOURCES="$SOURCES $srcdir/dynamic_fluidsynth.c $srcdir/fluidsynth.c"
    4.62              EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MID_FLUIDSYNTH"
    4.63              if test x$enable_music_midi_fluidsynth_shared = xyes && test x$fluidsynth_lib != x; then
    4.64                  echo "-- dynamic libfluidsyth -> $fluidsynth_lib"
    4.65 @@ -479,7 +466,6 @@
    4.66                      fi
    4.67                      ;;
    4.68              esac
    4.69 -            SOURCES="$SOURCES $srcdir/*_ogg.c"
    4.70              EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_OGG -DOGG_USE_TREMOR"
    4.71              if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
    4.72                  echo "-- dynamic libvorbisidec -> $ogg_lib"
    4.73 @@ -509,7 +495,6 @@
    4.74                      fi
    4.75                      ;;
    4.76              esac
    4.77 -            SOURCES="$SOURCES $srcdir/*_ogg.c"
    4.78              EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_OGG"
    4.79              if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
    4.80                  echo "-- dynamic libvorbisfile -> $ogg_lib"
    4.81 @@ -569,7 +554,6 @@
    4.82                      fi
    4.83                      ;;
    4.84              esac
    4.85 -            SOURCES="$SOURCES $srcdir/*_flac.c"
    4.86              EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_FLAC"
    4.87              if test x$enable_music_flac_shared = xyes && test x$flac_lib != x; then
    4.88                  echo "-- dynamic libFLAC -> $flac_lib"
    4.89 @@ -635,7 +619,6 @@
    4.90      ])
    4.91      AC_MSG_RESULT($have_libmad)
    4.92      if test x$have_libmad = xyes; then
    4.93 -        SOURCES="$SOURCES $srcdir/music_mad.c"
    4.94          EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MP3_MAD"
    4.95          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmad"
    4.96      else
    4.97 @@ -657,7 +640,6 @@
    4.98      ])
    4.99      AC_MSG_RESULT($have_libmpg123)
   4.100      if test x$have_libmpg123 = xyes; then
   4.101 -        SOURCES="$SOURCES $srcdir/music_mpg.c"
   4.102          EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MP3_MPG123"
   4.103          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmpg123"
   4.104      else
   4.105 @@ -666,7 +648,7 @@
   4.106  fi
   4.107  
   4.108  if test x$have_smpeg = xyes -o x$have_libmad = xyes -o x$have_libmpg123; then
   4.109 -    SOURCES="$SOURCES $srcdir/load_mp3.c"
   4.110 +    :
   4.111  else
   4.112      AC_MSG_WARN([MP3 support disabled])
   4.113  fi
     5.1 --- a/music.c	Tue Oct 17 02:54:52 2017 -0700
     5.2 +++ b/music.c	Tue Oct 17 16:43:23 2017 -0700
     5.3 @@ -299,9 +299,11 @@
     5.4      int i;
     5.5      SDL_bool use_native_midi = SDL_FALSE;
     5.6  
     5.7 +#ifdef MUSIC_MID_NATIVE
     5.8      if (SDL_GetHintBoolean("SDL_NATIVE_MUSIC", SDL_FALSE) && native_midi_detect()) {
     5.9          use_native_midi = SDL_TRUE;
    5.10      }
    5.11 +#endif
    5.12  
    5.13      music_spec = *spec;
    5.14      for (i = 0; i < SDL_arraysize(s_music_interfaces); ++i) {