1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 18:59:09 +00:00

Can you say KABOOM?

The data is interleaved. If you randomly change it up, OpenAL *will* crash
on you...
This commit is contained in:
2014-05-04 22:04:20 -04:00
parent 07810ffd9c
commit b3d6afc1c1
2 changed files with 0 additions and 18 deletions

View File

@ -134,15 +134,6 @@ bool plWin32StaticSound::LoadSound( bool is3D )
} }
uint32_t bufferSize = buffer->GetDataLength(); uint32_t bufferSize = buffer->GetDataLength();
if( header.fNumChannels > 1 && is3D )
{
// We can only do a single channel of 3D sound. So copy over one (later)
bufferSize /= header.fNumChannels;
header.fBlockAlign /= header.fNumChannels;
header.fAvgBytesPerSec /= header.fNumChannels;
header.fNumChannels = 1;
}
bool tryStatic = true; bool tryStatic = true;
// If we want FX, we can't use a static voice, but EAX doesn't fit under that limitation :) // If we want FX, we can't use a static voice, but EAX doesn't fit under that limitation :)
if( 0 ) if( 0 )

View File

@ -271,15 +271,6 @@ bool plWin32StreamingSound::LoadSound( bool is3D )
return false; return false;
} }
if( header.fNumChannels > 1 && is3D )
{
// We can only do a single channel of 3D sound. So copy over one (later)
bufferSize /= header.fNumChannels;
header.fBlockAlign /= header.fNumChannels;
header.fAvgBytesPerSec /= header.fNumChannels;
header.fNumChannels = 1;
}
// Actually create the buffer now (always looping) // Actually create the buffer now (always looping)
fDSoundBuffer = new plDSoundBuffer( bufferSize, header, is3D, IsPropertySet(kPropLooping), false, true ); fDSoundBuffer = new plDSoundBuffer( bufferSize, header, is3D, IsPropertySet(kPropLooping), false, true );
if( !fDSoundBuffer->IsValid() ) if( !fDSoundBuffer->IsValid() )