diff options
| author | Ray <raysan5@gmail.com> | 2016-05-21 20:11:23 +0200 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2016-05-21 20:11:23 +0200 |
| commit | 9811a376902b0f568f31d2e8aace28144fbf33ff (patch) | |
| tree | 26adf20c7a1f71cfc986df22c0f5e15520485ec1 /src/audio.c | |
| parent | 0b65b44a788d7b53c794ae3d197177ded844bb59 (diff) | |
| parent | dcd6942ed1ab703625f5c7072cbcfd823c681db7 (diff) | |
| download | raylib-9811a376902b0f568f31d2e8aace28144fbf33ff.tar.gz raylib-9811a376902b0f568f31d2e8aace28144fbf33ff.zip | |
Merge pull request #120 from victorfisac/develop
Standard Lighting (2/3)
Diffstat (limited to 'src/audio.c')
| -rw-r--r-- | src/audio.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/audio.c b/src/audio.c index 43e8be14..0c61c0fa 100644 --- a/src/audio.c +++ b/src/audio.c @@ -384,7 +384,7 @@ RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingP for(mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot { if(mixChannelsActive_g[mixIndex] == NULL) break; - else if(mixIndex = MAX_MIX_CHANNELS - 1) return -1; // error + else if(mixIndex == MAX_MIX_CHANNELS - 1) return -1; // error } if(InitMixChannel(sampleRate, mixIndex, channels, floatingPoint)) @@ -772,7 +772,7 @@ int PlayMusicStream(int musicIndex, char *fileName) for(mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot { if(mixChannelsActive_g[mixIndex] == NULL) break; - else if(mixIndex = MAX_MIX_CHANNELS - 1) return 2; // error + else if(mixIndex == MAX_MIX_CHANNELS - 1) return 2; // error } if (strcmp(GetExtension(fileName),"ogg") == 0) @@ -956,7 +956,7 @@ float GetMusicTimeLength(int index) // Get current music time played (in seconds) float GetMusicTimePlayed(int index) { - float secondsPlayed; + float secondsPlayed = 0.0f; if(index < MAX_MUSIC_STREAMS && currentMusic[index].mixc) { if (currentMusic[index].chipTune) @@ -972,7 +972,6 @@ float GetMusicTimePlayed(int index) secondsPlayed = (float)samplesPlayed / (currentMusic[index].mixc->sampleRate * currentMusic[index].mixc->channels); } } - return secondsPlayed; } |
