forked from teamnwah/openmw-tes3coop
Avoid using vector<>::data(), which requires C++11
This commit is contained in:
parent
8c4f78cc05
commit
b3caf82714
2 changed files with 6 additions and 6 deletions
|
@ -189,7 +189,7 @@ void MpgSnd_Decoder::readAll(std::vector<char> &output)
|
|||
{
|
||||
size_t pos = output.size();
|
||||
output.resize(pos + mSndInfo.frames*mSndInfo.channels*2);
|
||||
sf_readf_short(mSndFile, (short*)(output.data()+pos), mSndInfo.frames);
|
||||
sf_readf_short(mSndFile, (short*)(&output[0]+pos), mSndInfo.frames);
|
||||
return;
|
||||
}
|
||||
// Fallback in case we don't know the total already
|
||||
|
|
|
@ -222,8 +222,8 @@ void OpenAL_SoundStream::play()
|
|||
for(ALuint i = 0;i < sNumBuffers;i++)
|
||||
{
|
||||
size_t got;
|
||||
got = mDecoder->read(data.data(), data.size());
|
||||
alBufferData(mBuffers[i], mFormat, data.data(), got, mSampleRate);
|
||||
got = mDecoder->read(&data[0], data.size());
|
||||
alBufferData(mBuffers[i], mFormat, &data[0], got, mSampleRate);
|
||||
}
|
||||
throwALerror();
|
||||
|
||||
|
@ -299,11 +299,11 @@ bool OpenAL_SoundStream::process()
|
|||
if(finished)
|
||||
continue;
|
||||
|
||||
got = mDecoder->read(data.data(), data.size());
|
||||
got = mDecoder->read(&data[0], data.size());
|
||||
finished = (got < data.size());
|
||||
if(got > 0)
|
||||
{
|
||||
alBufferData(bufid, mFormat, data.data(), got, mSampleRate);
|
||||
alBufferData(bufid, mFormat, &data[0], got, mSampleRate);
|
||||
alSourceQueueBuffers(mSource, 1, &bufid);
|
||||
}
|
||||
} while(processed > 0);
|
||||
|
@ -595,7 +595,7 @@ ALuint OpenAL_Output::getBuffer(const std::string &fname)
|
|||
alGenBuffers(1, &buf);
|
||||
throwALerror();
|
||||
|
||||
alBufferData(buf, format, data.data(), data.size(), srate);
|
||||
alBufferData(buf, format, &data[0], data.size(), srate);
|
||||
mBufferCache[fname] = buf;
|
||||
mBufferRefs[buf] = 1;
|
||||
|
||||
|
|
Loading…
Reference in a new issue