Skip to content

Commit

Permalink
Fix up some small typos and avoid c++11's string::back()/pop_back() c…
Browse files Browse the repository at this point in the history
…alls for now.
  • Loading branch information
Shyotl committed Dec 9, 2014
1 parent ab4561a commit e2cd11c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion indra/llaudio/llaudioengine_fmodex.cpp
Expand Up @@ -373,7 +373,7 @@ bool LLAudioEngine_FMODEX::init(const S32 num_channels, void* userdata)
if (NULL == getenv("LL_BAD_FMOD_OSS")) /*Flawfinder: ignore*/
{
LL_DEBUGS("AppInit") << "Trying OSS audio output..." << LL_ENDL;
if((result = mSystem->setOutput(FMOD_OUTPUTTYPE_OSS) == FMOD_OK) &&
if((result = mSystem->setOutput(FMOD_OUTPUTTYPE_OSS)) == FMOD_OK &&
(result = mSystem->init(num_channels + 2, fmod_flags, 0)) == FMOD_OK)
{
LL_DEBUGS("AppInit") << "OSS audio output initialized OKAY" << LL_ENDL;
Expand Down
2 changes: 1 addition & 1 deletion indra/llaudio/llaudioengine_fmodstudio.cpp
Expand Up @@ -372,7 +372,7 @@ bool LLAudioEngine_FMODSTUDIO::init(const S32 num_channels, void* userdata)
if (NULL == getenv("LL_BAD_FMOD_OSS")) /*Flawfinder: ignore*/
{
LL_DEBUGS("AppInit") << "Trying OSS audio output..." << LL_ENDL;
if((result = mSystem->setOutput(FMOD_OUTPUTTYPE_OSS) == FMOD_OK) &&
if((result = mSystem->setOutput(FMOD_OUTPUTTYPE_OSS)) == FMOD_OK &&
(result = mSystem->init(num_channels + 2, fmod_flags, 0)) == FMOD_OK)
{
LL_DEBUGS("AppInit") << "OSS audio output initialized OKAY" << LL_ENDL;
Expand Down
22 changes: 11 additions & 11 deletions indra/llaudio/llstreamingaudio_fmodex.cpp
Expand Up @@ -289,8 +289,8 @@ void LLStreamingAudio_FMODEX::update()
case(FMOD_TAGDATATYPE_STRING):
{
std::string out = rawstr_to_utf8(std::string((char*)tag.data,tag.datalen));
if (out.length() && out.back() == 0)
out.pop_back();
if (out.length() && out[out.size() - 1] == 0)
out.erase(out.size() - 1);
(*mMetaData)[name]=out;
llinfos << tag.name << "(RAW): " << out << llendl;
}
Expand All @@ -301,26 +301,26 @@ void LLStreamingAudio_FMODEX::update()
if (tag.datalen > 3 && ((char*)tag.data)[0] == 0xEF && ((char*)tag.data)[1] == 0xBB && ((char*)tag.data)[2] == 0xBF)
offs = 3;
std::string out((char*)tag.data + offs, tag.datalen - offs);
if (out.length() && out.back() == 0)
out.pop_back();
if (out.length() && out[out.size() - 1] == 0)
out.erase(out.size() - 1);
(*mMetaData)[name] = out;
llinfos << tag.name << "(UTF8): " << out << llendl;
}
break;
case(FMOD_TAGDATATYPE_STRING_UTF16):
{
std::string out = utf16input_to_utf8((char*)tag.data, tag.datalen, UTF16);
if (out.length() && out.back() == 0)
out.pop_back();
if (out.length() && out[out.size() - 1] == 0)
out.erase(out.size() - 1);
(*mMetaData)[name] = out;
llinfos << tag.name << "(UTF16): " << out << llendl;
}
break;
case(FMOD_TAGDATATYPE_STRING_UTF16BE):
{
std::string out = utf16input_to_utf8((char*)tag.data, tag.datalen, UTF16BE);
if (out.length() && out.back() == 0)
out.pop_back();
if (out.length() && out[out.size() - 1] == 0)
out.erase(out.size() - 1);
(*mMetaData)[name] = out;
llinfos << tag.name << "(UTF16BE): " << out << llendl;
}
Expand Down Expand Up @@ -568,18 +568,18 @@ void LLStreamingAudio_FMODEX::setBufferSizes(U32 streambuffertime, U32 decodebuf
Check_FMOD_Error(mSystem->setStreamBufferSize(streambuffertime / 1000 * 128 * 128, FMOD_TIMEUNIT_RAWBYTES), "FMOD::System::setStreamBufferSize");
FMOD_ADVANCEDSETTINGS settings;
memset(&settings,0,sizeof(settings));
settings.cbSize=sizeof(settings);
settings.cbsize=sizeof(settings);
settings.defaultDecodeBufferSize = decodebuffertime;//ms
Check_FMOD_Error(mSystem->setAdvancedSettings(&settings), "FMOD::System::setAdvancedSettings");
}

bool LLStreamingAudio_FMODEX::releaseDeadStreams()
{
// Kill dead internet streams, if possible
std::list<LLAudioStreamManagerFMODSTUDIO *>::iterator iter;
std::list<LLAudioStreamManagerFMODEX *>::iterator iter;
for (iter = mDeadStreams.begin(); iter != mDeadStreams.end();)
{
LLAudioStreamManagerFMODSTUDIO *streamp = *iter;
LLAudioStreamManagerFMODEX *streamp = *iter;
if (streamp->stopStream())
{
llinfos << "Closed dead stream" << llendl;
Expand Down
18 changes: 9 additions & 9 deletions indra/llaudio/llstreamingaudio_fmodstudio.cpp
Expand Up @@ -142,7 +142,7 @@ LLStreamingAudio_FMODSTUDIO::LLStreamingAudio_FMODSTUDIO(FMOD::System *system) :
// Leave the net buffer properties at the default.
//FSOUND_Stream_Net_SetBufferProperties(20000, 40, 80);

Check_FMOD_Error(system->createChannelGroup("stream", &mStreamGroup), "FMOD::System::createChannelGroup");
Check_FMOD_Error(mSystem->createChannelGroup("stream", &mStreamGroup), "FMOD::System::createChannelGroup");

FMOD_DSP_DESCRIPTION dspdesc;
memset(&dspdesc, 0, sizeof(FMOD_DSP_DESCRIPTION)); //Zero out everything
Expand Down Expand Up @@ -353,8 +353,8 @@ void LLStreamingAudio_FMODSTUDIO::update()
case(FMOD_TAGDATATYPE_STRING):
{
std::string out = rawstr_to_utf8(std::string((char*)tag.data,tag.datalen));
if (out.length() && out.back() == 0)
out.pop_back();
if (out.length() && out[out.size() - 1] == 0)
out.erase(out.size() - 1);
(*mMetaData)[name]=out;
llinfos << tag.name << "(RAW): " << out << llendl;
}
Expand All @@ -365,26 +365,26 @@ void LLStreamingAudio_FMODSTUDIO::update()
if (tag.datalen > 3 && ((char*)tag.data)[0] == 0xEF && ((char*)tag.data)[1] == 0xBB && ((char*)tag.data)[2] == 0xBF)
offs = 3;
std::string out((char*)tag.data + offs, tag.datalen - offs);
if (out.length() && out.back() == 0)
out.pop_back();
if (out.length() && out[out.size() - 1] == 0)
out.erase(out.size() - 1);
(*mMetaData)[name] = out;
llinfos << tag.name << "(UTF8): " << out << llendl;
}
break;
case(FMOD_TAGDATATYPE_STRING_UTF16):
{
std::string out = utf16input_to_utf8((char*)tag.data, tag.datalen, UTF16);
if (out.length() && out.back() == 0)
out.pop_back();
if (out.length() && out[out.size() - 1] == 0)
out.erase(out.size() - 1);
(*mMetaData)[name] = out;
llinfos << tag.name << "(UTF16): " << out << llendl;
}
break;
case(FMOD_TAGDATATYPE_STRING_UTF16BE):
{
std::string out = utf16input_to_utf8((char*)tag.data, tag.datalen, UTF16BE);
if (out.length() && out.back() == 0)
out.pop_back();
if (out.length() && out[out.size() - 1] == 0)
out.erase(out.size() - 1);
(*mMetaData)[name] = out;
llinfos << tag.name << "(UTF16BE): " << out << llendl;
}
Expand Down

0 comments on commit e2cd11c

Please sign in to comment.