Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6729


Ignore:
Timestamp:
Apr 15, 2010, 1:32:59 PM (15 years ago)
Author:
erwin
Message:

Commit changes to transfer to netbook

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/sound5/src/orxonox/sound/SoundStreamer.cc

    r6726 r6729  
    107107            if(alcGetCurrentContext() == NULL)
    108108            {
    109                 COUT(2) << "Sound: There is no context, terminating thread" << std::endl;
     109                COUT(2) << "Sound: There is no context, terminating thread for " << dataStream->getName() << std::endl;
    110110                return;
    111111            }
     
    123123                    COUT(2) << "Sound: Warning: Couldn't unqueue buffers: " << getALErrorString(error) << std::endl;
    124124
     125                int info;
     126                alGetSourcei(audioSource, AL_SOURCE_STATE, &info);
     127                if(info == AL_PLAYING)
     128                    COUT(4) << "Sound: " << dataStream->getName() << " is playing." << std::endl;
     129                else
     130                    COUT(4) << "Sound: " << dataStream->getName() << " is not playing." << std::endl;
     131
    125132                for(int i = 0; i < processed; i++)
    126133                {
     
    132139                    else if (ret < 0)
    133140                    {
    134                         COUT(2) << "Sound: libvorbisfile: error reading the file" << std::endl;
     141                        COUT(2) << "Sound: libvorbisfile: error reading the file " << dataStream->getName() << std::endl;
    135142                        ov_clear(&vf);
    136143                        return;
     
    153160            catch(boost::thread_interrupted) {
    154161                COUT(4) << "Sound: Catched interruption. Terminating thread for " << dataStream->getName() << std::endl;
     162                ALuint* buffers = new ALuint[5];
     163                alSourceUnqueueBuffers(audioSource, 5, buffers);
     164                if (ALint error = alGetError())
     165                    COUT(2) << "Sound: Warning: Couldn't unqueue buffers: " << getALErrorString(error) << std::endl;
     166
     167                alDeleteBuffers(5, buffers);
     168                if (ALint error = alGetError())
     169                    COUT(2) << "Sound: Warning: Couldn't delete buffers: " << getALErrorString(error) << std::endl;
     170
    155171                return;
    156172            }
Note: See TracChangeset for help on using the changeset viewer.