Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

SDLx::Sound fixed for older version of SDL_Mixer

  • Loading branch information...
commit 790292f44fbf6b51418cedf20f2d4c528e862cbc 1 parent 84b664c
@kthakore kthakore authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/SDLx/Sound.pm
View
7 lib/SDLx/Sound.pm
@@ -31,10 +31,13 @@ sub _initAudio {
}
sub _initMixer {
- my $init_flags = SDL::Mixer::init( MIX_INIT_MP3 | MIX_INIT_MOD | MIX_INIT_FLAC | MIX_INIT_OGG );
-
+ my $init_flags = SDL::Mixer::init( MIX_INIT_MP3 | MIX_INIT_MOD | MIX_INIT_FLAC | MIX_INIT_OGG );
+
my %init = ();
+ # Short circuit if we have and older version of SDL_Mixer
+ return \%$init unless $init_flags;
+
$init{ mp3 } = 1 if $init_flags & MIX_INIT_MP3;
$init{ mod } = 1 if $init_flags & MIX_INIT_MOD;
$init{ flac } = 1 if $init_flags & MIX_INIT_FLAC;
Please sign in to comment.
Something went wrong with that request. Please try again.