summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Næsbye Christensen <lars@naesbye.dk>2024-02-09 01:50:51 +0100
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-02-12 23:17:22 +0200
commit79ceefe56b5fabdbcc1476d1d5b8253aa405ed21 (patch)
treea31a9370f705718400ea0f4e7917d0d6cf37c6da
parent5d8f1e4dbdce601fa0af80cbc0409332bc396778 (diff)
llaudio: BOOL (int) to real bool
-rwxr-xr-xindra/llaudio/llaudiodecodemgr.cpp78
-rw-r--r--indra/llaudio/llaudiodecodemgr.h2
-rwxr-xr-xindra/llaudio/llaudioengine.h2
-rw-r--r--indra/llaudio/llvorbisencode.cpp4
4 files changed, 43 insertions, 43 deletions
diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp
index 190c5290cb..4b23b37cc9 100755
--- a/indra/llaudio/llaudiodecodemgr.cpp
+++ b/indra/llaudio/llaudiodecodemgr.cpp
@@ -70,22 +70,22 @@ public:
LLVorbisDecodeState(const LLUUID &uuid, const std::string &out_filename);
- BOOL initDecode();
- BOOL decodeSection(); // Return TRUE if done.
- BOOL finishDecode();
+ bool initDecode();
+ bool decodeSection(); // Return true if done.
+ bool finishDecode();
void flushBadFile();
void ioComplete(S32 bytes) { mBytesRead = bytes; }
- BOOL isValid() const { return mValid; }
- BOOL isDone() const { return mDone; }
+ bool isValid() const { return mValid; }
+ bool isDone() const { return mDone; }
const LLUUID &getUUID() const { return mUUID; }
protected:
virtual ~LLVorbisDecodeState();
- BOOL mValid;
- BOOL mDone;
+ bool mValid;
+ bool mDone;
LLAtomicS32 mBytesRead;
LLUUID mUUID;
@@ -164,8 +164,8 @@ long cache_tell (void *datasource)
LLVorbisDecodeState::LLVorbisDecodeState(const LLUUID &uuid, const std::string &out_filename)
{
- mDone = FALSE;
- mValid = FALSE;
+ mDone = false;
+ mValid = false;
mBytesRead = -1;
mUUID = uuid;
mInFilep = NULL;
@@ -188,7 +188,7 @@ LLVorbisDecodeState::~LLVorbisDecodeState()
}
-BOOL LLVorbisDecodeState::initDecode()
+bool LLVorbisDecodeState::initDecode()
{
ov_callbacks cache_callbacks;
cache_callbacks.read_func = cache_read;
@@ -204,14 +204,14 @@ BOOL LLVorbisDecodeState::initDecode()
LL_WARNS("AudioEngine") << "unable to open vorbis source vfile for reading" << LL_ENDL;
delete mInFilep;
mInFilep = NULL;
- return FALSE;
+ return false;
}
S32 r = ov_open_callbacks(mInFilep, &mVF, NULL, 0, cache_callbacks);
if(r < 0)
{
LL_WARNS("AudioEngine") << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << mUUID << LL_ENDL;
- return(FALSE);
+ return(false);
}
S32 sample_count = (S32)ov_pcm_total(&mVF, -1);
@@ -260,7 +260,7 @@ BOOL LLVorbisDecodeState::initDecode()
}
delete mInFilep;
mInFilep = NULL;
- return FALSE;
+ return false;
}
try
@@ -273,7 +273,7 @@ BOOL LLVorbisDecodeState::initDecode()
LL_WARNS("AudioEngine") << "Out of memory when trying to alloc buffer: " << size_guess << LL_ENDL;
delete mInFilep;
mInFilep = NULL;
- return FALSE;
+ return false;
}
{
@@ -360,31 +360,31 @@ BOOL LLVorbisDecodeState::initDecode()
// fprintf(stderr,"\nDecoded length: %ld samples\n", (long)ov_pcm_total(&vf,-1));
// fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
//}
- return TRUE;
+ return true;
}
-BOOL LLVorbisDecodeState::decodeSection()
+bool LLVorbisDecodeState::decodeSection()
{
if (!mInFilep)
{
LL_WARNS("AudioEngine") << "No cache file to decode in vorbis!" << LL_ENDL;
- return TRUE;
+ return true;
}
if (mDone)
{
// LL_WARNS("AudioEngine") << "Already done with decode, aborting!" << LL_ENDL;
- return TRUE;
+ return true;
}
char pcmout[4096]; /*Flawfinder: ignore*/
- BOOL eof = FALSE;
+ bool eof = false;
long ret=ov_read(&mVF, pcmout, sizeof(pcmout), 0, 2, 1, &mCurrentSection);
if (ret == 0)
{
/* EOF */
- eof = TRUE;
- mDone = TRUE;
- mValid = TRUE;
+ eof = true;
+ mDone = true;
+ mValid = true;
// LL_INFOS("AudioEngine") << "Vorbis EOF" << LL_ENDL;
}
else if (ret < 0)
@@ -394,10 +394,10 @@ BOOL LLVorbisDecodeState::decodeSection()
LL_WARNS("AudioEngine") << "BAD vorbis decode in decodeSection." << LL_ENDL;
- mValid = FALSE;
- mDone = TRUE;
- // We're done, return TRUE.
- return TRUE;
+ mValid = false;
+ mDone = true;
+ // We're done, return true.
+ return true;
}
else
{
@@ -409,12 +409,12 @@ BOOL LLVorbisDecodeState::decodeSection()
return eof;
}
-BOOL LLVorbisDecodeState::finishDecode()
+bool LLVorbisDecodeState::finishDecode()
{
if (!isValid())
{
LL_WARNS("AudioEngine") << "Bogus vorbis decode state for " << getUUID() << ", aborting!" << LL_ENDL;
- return TRUE; // We've finished
+ return true; // We've finished
}
if (mFileHandle == LLLFSThread::nullHandle())
@@ -487,8 +487,8 @@ BOOL LLVorbisDecodeState::finishDecode()
if (36 == data_length)
{
LL_WARNS("AudioEngine") << "BAD Vorbis decode in finishDecode!" << LL_ENDL;
- mValid = FALSE;
- return TRUE; // we've finished
+ mValid = false;
+ return true; // we've finished
}
mBytesRead = -1;
mFileHandle = LLLFSThread::sLocal->write(mOutFilename, &mWAVBuffer[0], 0, mWAVBuffer.size(),
@@ -502,21 +502,21 @@ BOOL LLVorbisDecodeState::finishDecode()
if (mBytesRead == 0)
{
LL_WARNS("AudioEngine") << "Unable to write file in LLVorbisDecodeState::finishDecode" << LL_ENDL;
- mValid = FALSE;
- return TRUE; // we've finished
+ mValid = false;
+ return true; // we've finished
}
}
else
{
- return FALSE; // not done
+ return false; // not done
}
}
- mDone = TRUE;
+ mDone = true;
LL_DEBUGS("AudioEngine") << "Finished decode for " << getUUID() << LL_ENDL;
- return TRUE;
+ return true;
}
void LLVorbisDecodeState::flushBadFile()
@@ -779,13 +779,13 @@ void LLAudioDecodeMgr::processQueue()
mImpl->processQueue();
}
-BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
+bool LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
{
if (gAudiop && gAudiop->hasDecodedFile(uuid))
{
// Already have a decoded version, don't need to decode it.
LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " has decoded file already" << LL_ENDL;
- return TRUE;
+ return true;
}
if (gAssetStorage->hasLocalAsset(uuid, LLAssetType::AT_SOUND))
@@ -793,9 +793,9 @@ BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
// Just put it on the decode queue.
LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " has local asset file already" << LL_ENDL;
mImpl->mDecodeQueue.push_back(uuid);
- return TRUE;
+ return true;
}
LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " no file available" << LL_ENDL;
- return FALSE;
+ return false;
}
diff --git a/indra/llaudio/llaudiodecodemgr.h b/indra/llaudio/llaudiodecodemgr.h
index 4c17b46156..8c8d103c40 100644
--- a/indra/llaudio/llaudiodecodemgr.h
+++ b/indra/llaudio/llaudiodecodemgr.h
@@ -43,7 +43,7 @@ class LLAudioDecodeMgr : public LLSingleton<LLAudioDecodeMgr>
~LLAudioDecodeMgr();
public:
void processQueue();
- BOOL addDecodeRequest(const LLUUID &uuid);
+ bool addDecodeRequest(const LLUUID &uuid);
void addAudioRequest(const LLUUID &uuid);
protected:
diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h
index c045d18c42..099d948f87 100755
--- a/indra/llaudio/llaudioengine.h
+++ b/indra/llaudio/llaudioengine.h
@@ -265,7 +265,7 @@ public:
void preload(const LLUUID &audio_id); // Only used for preloading UI sounds, now.
- void addAudioData(LLAudioData *adp, bool set_current = TRUE);
+ void addAudioData(LLAudioData *adp, bool set_current = true);
void setForcedPriority(const bool ambient) { mForcedPriority = ambient; }
bool isForcedPriority() const { return mForcedPriority; }
diff --git a/indra/llaudio/llvorbisencode.cpp b/indra/llaudio/llvorbisencode.cpp
index 2e1ed9b505..cfb2efbdbc 100644
--- a/indra/llaudio/llvorbisencode.cpp
+++ b/indra/llaudio/llvorbisencode.cpp
@@ -75,7 +75,7 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
U32 chunk_length = 0;
U32 raw_data_length = 0;
U32 bytes_per_sec = 0;
- BOOL uncompressed_pcm = FALSE;
+ bool uncompressed_pcm = false;
unsigned char wav_header[44]; /*Flawfinder: ignore*/
@@ -133,7 +133,7 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
{
if ((wav_header[8] == 0x01) && (wav_header[9] == 0x00))
{
- uncompressed_pcm = TRUE;
+ uncompressed_pcm = true;
}
num_channels = ((U16) wav_header[11] << 8) + wav_header[10];
sample_rate = ((U32) wav_header[15] << 24)