aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llaudio/llaudiodecodemgr.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llaudio/llaudiodecodemgr.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/llaudio/llaudiodecodemgr.cpp')
-rw-r--r--linden/indra/llaudio/llaudiodecodemgr.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/linden/indra/llaudio/llaudiodecodemgr.cpp b/linden/indra/llaudio/llaudiodecodemgr.cpp
index af7ab92..7cd48a9 100644
--- a/linden/indra/llaudio/llaudiodecodemgr.cpp
+++ b/linden/indra/llaudio/llaudiodecodemgr.cpp
@@ -70,7 +70,7 @@ public:
70 LLPointer<LLVorbisDecodeState> mDecoder; 70 LLPointer<LLVorbisDecodeState> mDecoder;
71 }; 71 };
72 72
73 LLVorbisDecodeState(const LLUUID &uuid, const LLString &out_filename); 73 LLVorbisDecodeState(const LLUUID &uuid, const std::string &out_filename);
74 74
75 BOOL initDecode(); 75 BOOL initDecode();
76 BOOL decodeSection(); // Return TRUE if done. 76 BOOL decodeSection(); // Return TRUE if done.
@@ -93,7 +93,7 @@ protected:
93 93
94 std::vector<U8> mWAVBuffer; 94 std::vector<U8> mWAVBuffer;
95#if !defined(USE_WAV_VFILE) 95#if !defined(USE_WAV_VFILE)
96 LLString mOutFilename; 96 std::string mOutFilename;
97 LLLFSThread::handle_t mFileHandle; 97 LLLFSThread::handle_t mFileHandle;
98#endif 98#endif
99 99
@@ -166,7 +166,7 @@ long vfs_tell (void *datasource)
166 return file->tell(); 166 return file->tell();
167} 167}
168 168
169LLVorbisDecodeState::LLVorbisDecodeState(const LLUUID &uuid, const LLString &out_filename) 169LLVorbisDecodeState::LLVorbisDecodeState(const LLUUID &uuid, const std::string &out_filename)
170{ 170{
171 mDone = FALSE; 171 mDone = FALSE;
172 mValid = FALSE; 172 mValid = FALSE;
@@ -386,7 +386,7 @@ BOOL LLVorbisDecodeState::finishDecode()
386 mWAVBuffer[7] = (data_length >> 24) & 0x000000FF; 386 mWAVBuffer[7] = (data_length >> 24) & 0x000000FF;
387 387
388 // 388 //
389 // FUCK!!! Vorbis encode/decode messes up loop point transitions (pop) 389 // FUDGECAKES!!! Vorbis encode/decode messes up loop point transitions (pop)
390 // do a cheap-and-cheesy crossfade 390 // do a cheap-and-cheesy crossfade
391 // 391 //
392 { 392 {
@@ -413,12 +413,12 @@ BOOL LLVorbisDecodeState::finishDecode()
413 if((WAV_HEADER_SIZE+(2 * fade_length)) < (S32)mWAVBuffer.size()) 413 if((WAV_HEADER_SIZE+(2 * fade_length)) < (S32)mWAVBuffer.size())
414 { 414 {
415 memcpy(&mWAVBuffer[WAV_HEADER_SIZE], pcmout, (2 * fade_length)); /*Flawfinder: ignore*/ 415 memcpy(&mWAVBuffer[WAV_HEADER_SIZE], pcmout, (2 * fade_length)); /*Flawfinder: ignore*/
416 } 416 }
417 S32 near_end = mWAVBuffer.size() - (2 * fade_length); 417 S32 near_end = mWAVBuffer.size() - (2 * fade_length);
418 if ((S32)mWAVBuffer.size() >= ( near_end + 2* fade_length)) 418 if ((S32)mWAVBuffer.size() >= ( near_end + 2* fade_length))
419 { 419 {
420 memcpy(pcmout, &mWAVBuffer[near_end], (2 * fade_length)); /*Flawfinder: ignore*/ 420 memcpy(pcmout, &mWAVBuffer[near_end], (2 * fade_length)); /*Flawfinder: ignore*/
421 } 421 }
422 llendianswizzle(&pcmout, 2, fade_length); 422 llendianswizzle(&pcmout, 2, fade_length);
423 423
424 samplep = (S16 *)pcmout; 424 samplep = (S16 *)pcmout;
@@ -443,8 +443,8 @@ BOOL LLVorbisDecodeState::finishDecode()
443 } 443 }
444#if !defined(USE_WAV_VFILE) 444#if !defined(USE_WAV_VFILE)
445 mBytesRead = -1; 445 mBytesRead = -1;
446 mFileHandle = LLLFSThread::sLocal->write(mOutFilename, &mWAVBuffer[0], 0, data_length, 446 mFileHandle = LLLFSThread::sLocal->write(mOutFilename, &mWAVBuffer[0], 0, mWAVBuffer.size(),
447 new WriteResponder(this)); 447 new WriteResponder(this));
448#endif 448#endif
449 } 449 }
450 450
@@ -583,14 +583,14 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
583 583
584 lldebugs << "Decoding " << uuid << " from audio queue!" << llendl; 584 lldebugs << "Decoding " << uuid << " from audio queue!" << llendl;
585 585
586 char uuid_str[64]; /*Flawfinder: ignore*/ 586 std::string uuid_str;
587 char d_path[LL_MAX_PATH]; /*Flawfinder: ignore*/ 587 std::string d_path;
588 588
589 LLTimer timer; 589 LLTimer timer;
590 timer.reset(); 590 timer.reset();
591 591
592 uuid.toString(uuid_str); 592 uuid.toString(uuid_str);
593 snprintf(d_path, LL_MAX_PATH, "%s.dsf", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str()); /* Flawfinder: ignore */ 593 d_path = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str) + ".dsf";
594 594
595 mCurrentDecodep = new LLVorbisDecodeState(uuid, d_path); 595 mCurrentDecodep = new LLVorbisDecodeState(uuid, d_path);
596 if (!mCurrentDecodep->initDecode()) 596 if (!mCurrentDecodep->initDecode())