Switched magnification to percentage, added black-border as alternative to scale
[supertux.git] / src / audio / stream_sound_source.cpp
index 3569ecd..5a01723 100644 (file)
@@ -78,8 +78,8 @@ StreamSoundSource::update()
   if(!playing()) {
     if(processed == 0 || !looping)
       return;
-    
-    // we might have to restart the source if we had a buffer underrun  
+
+    // we might have to restart the source if we had a buffer underrun
     log_info << "Restarting audio source because of buffer underrun" << std::endl;
     play();
   }
@@ -132,14 +132,13 @@ StreamSoundSource::fillBufferAndQueue(ALuint buffer)
   if(bytesread > 0) {
     ALenum format = SoundManager::get_sample_format(file);
     alBufferData(buffer, format, bufferdata, bytesread, file->rate);
-    delete[] bufferdata;
     SoundManager::check_al_error("Couldn't refill audio buffer: ");
 
     alSourceQueueBuffers(source, 1, &buffer);
     SoundManager::check_al_error("Couldn't queue audio buffer: ");
   }
+  delete[] bufferdata;
 
   // return false if there aren't more buffers to fill
   return bytesread >= STREAMFRAGMENTSIZE;
 }
-