diff --git a/src/audio.c b/src/audio.c index 4ba133e24..8ef711163 100644 --- a/src/audio.c +++ b/src/audio.c @@ -105,7 +105,6 @@ static void UnloadWave(Wave wave); // Unload wave data static bool BufferMusicStream(ALuint buffer); // Fill music buffers with data static void EmptyMusicStream(void); // Empty music buffers -extern void UpdateMusicStream(void); // Updates buffers (refill) for music streaming #if defined(AUDIO_STANDALONE) const char *GetExtension(const char *fileName); // Get the extension for a filename @@ -539,7 +538,7 @@ void PlayMusicStream(char *fileName) TraceLog(INFO, "[%s] Ogg sample rate: %i", fileName, info.sample_rate); TraceLog(INFO, "[%s] Ogg channels: %i", fileName, info.channels); - TraceLog(INFO, "[%s] Temp memory required: %i", fileName, info.temp_memory_required); + TraceLog(DEBUG, "[%s] Temp memory required: %i", fileName, info.temp_memory_required); if (info.channels == 2) currentMusic.format = AL_FORMAT_STEREO16; else currentMusic.format = AL_FORMAT_MONO16; @@ -567,7 +566,7 @@ void PlayMusicStream(char *fileName) alSourceQueueBuffers(currentMusic.source, 2, currentMusic.buffers); alSourcePlay(currentMusic.source); - // NOTE: Regularly, we must check if a buffer has been processed and refill it: MusicStreamUpdate() + // NOTE: Regularly, we must check if a buffer has been processed and refill it: UpdateMusicStream() currentMusic.totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic.stream) * currentMusic.channels; } @@ -708,7 +707,7 @@ static void EmptyMusicStream(void) alGetSourcei(currentMusic.source, AL_BUFFERS_QUEUED, &queued); - while(queued > 0) + while (queued > 0) { alSourceUnqueueBuffers(currentMusic.source, 1, &buffer); @@ -739,19 +738,16 @@ void UpdateMusicStream(void) // If no more data to stream, restart music (if loop) if ((!active) && (currentMusic.loop)) { - if (currentMusic.loop) - { - stb_vorbis_seek_start(currentMusic.stream); - currentMusic.totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic.stream) * currentMusic.channels; + stb_vorbis_seek_start(currentMusic.stream); + currentMusic.totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic.stream)*currentMusic.channels; - active = BufferMusicStream(buffer); - } + active = BufferMusicStream(buffer); } // Add refilled buffer to queue again... don't let the music stop! alSourceQueueBuffers(currentMusic.source, 1, &buffer); - if(alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Ogg playing, error buffering data..."); + if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Ogg playing, error buffering data..."); processed--; }