[Orxonox-commit 2012] r6729 - code/branches/sound5/src/orxonox/sound
erwin at orxonox.net
erwin at orxonox.net
Thu Apr 15 13:32:59 CEST 2010
Author: erwin
Date: 2010-04-15 13:32:59 +0200 (Thu, 15 Apr 2010)
New Revision: 6729
Modified:
code/branches/sound5/src/orxonox/sound/SoundStreamer.cc
Log:
Commit changes to transfer to netbook
Modified: code/branches/sound5/src/orxonox/sound/SoundStreamer.cc
===================================================================
--- code/branches/sound5/src/orxonox/sound/SoundStreamer.cc 2010-04-15 11:15:11 UTC (rev 6728)
+++ code/branches/sound5/src/orxonox/sound/SoundStreamer.cc 2010-04-15 11:32:59 UTC (rev 6729)
@@ -106,7 +106,7 @@
if(alcGetCurrentContext() == NULL)
{
- COUT(2) << "Sound: There is no context, terminating thread" << std::endl;
+ COUT(2) << "Sound: There is no context, terminating thread for " << dataStream->getName() << std::endl;
return;
}
@@ -122,6 +122,13 @@
if (ALint error = alGetError())
COUT(2) << "Sound: Warning: Couldn't unqueue buffers: " << getALErrorString(error) << std::endl;
+ int info;
+ alGetSourcei(audioSource, AL_SOURCE_STATE, &info);
+ if(info == AL_PLAYING)
+ COUT(4) << "Sound: " << dataStream->getName() << " is playing." << std::endl;
+ else
+ COUT(4) << "Sound: " << dataStream->getName() << " is not playing." << std::endl;
+
for(int i = 0; i < processed; i++)
{
long ret = ov_read(&vf, inbuffer, sizeof(inbuffer), 0, 2, 1, ¤t_section);
@@ -131,7 +138,7 @@
}
else if (ret < 0)
{
- COUT(2) << "Sound: libvorbisfile: error reading the file" << std::endl;
+ COUT(2) << "Sound: libvorbisfile: error reading the file " << dataStream->getName() << std::endl;
ov_clear(&vf);
return;
}
@@ -152,6 +159,15 @@
}
catch(boost::thread_interrupted) {
COUT(4) << "Sound: Catched interruption. Terminating thread for " << dataStream->getName() << std::endl;
+ ALuint* buffers = new ALuint[5];
+ alSourceUnqueueBuffers(audioSource, 5, buffers);
+ if (ALint error = alGetError())
+ COUT(2) << "Sound: Warning: Couldn't unqueue buffers: " << getALErrorString(error) << std::endl;
+
+ alDeleteBuffers(5, buffers);
+ if (ALint error = alGetError())
+ COUT(2) << "Sound: Warning: Couldn't delete buffers: " << getALErrorString(error) << std::endl;
+
return;
}
msleep(100); // perhaps another value here is better
More information about the Orxonox-commit
mailing list