From ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Thu, 30 Apr 2009 13:04:20 -0500 Subject: Second Life viewer sources 1.23.0-RC --- linden/indra/llaudio/audioengine.cpp | 13 +++--- linden/indra/llaudio/audioengine.h | 3 +- linden/indra/llaudio/audioengine_fmod.cpp | 10 ++--- linden/indra/llaudio/audioengine_fmod.h | 3 +- linden/indra/llaudio/audioengine_openal.cpp | 3 +- linden/indra/llaudio/audioengine_openal.h | 3 +- linden/indra/llaudio/listener.cpp | 3 +- linden/indra/llaudio/listener.h | 3 +- linden/indra/llaudio/listener_ds3d.h | 3 +- linden/indra/llaudio/listener_fmod.cpp | 3 +- linden/indra/llaudio/listener_fmod.h | 3 +- linden/indra/llaudio/listener_openal.cpp | 3 +- linden/indra/llaudio/listener_openal.h | 3 +- linden/indra/llaudio/llaudiodecodemgr.cpp | 3 +- linden/indra/llaudio/llaudiodecodemgr.h | 3 +- linden/indra/llaudio/vorbisdecode.cpp | 49 +++++++++++++---------- linden/indra/llaudio/vorbisdecode.h | 3 +- linden/indra/llaudio/vorbisencode.cpp | 62 +++++++++++++++-------------- linden/indra/llaudio/vorbisencode.h | 3 +- linden/indra/llaudio/windgen.h | 3 +- 20 files changed, 103 insertions(+), 79 deletions(-) (limited to 'linden/indra/llaudio') diff --git a/linden/indra/llaudio/audioengine.cpp b/linden/indra/llaudio/audioengine.cpp index c5bc367..d8082aa 100644 --- a/linden/indra/llaudio/audioengine.cpp +++ b/linden/indra/llaudio/audioengine.cpp @@ -18,7 +18,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, @@ -96,11 +97,11 @@ void LLAudioEngine::setDefaults() mInternetStreamGain = 0.125f; mNextWindUpdate = 0.f; - for (U32 i = 0; i < LLAudioEngine::AUDIO_TYPE_COUNT; i++) - mSecondaryGain[i] = 1.0f; - mInternetStreamMedia = NULL; mInternetStreamURL.clear(); + + for (U32 i = 0; i < LLAudioEngine::AUDIO_TYPE_COUNT; i++) + mSecondaryGain[i] = 1.0f; } @@ -1624,7 +1625,9 @@ bool LLAudioSource::hasPendingPreloads() const for (iter = mPreloadMap.begin(); iter != mPreloadMap.end(); iter++) { LLAudioData *adp = iter->second; - if (!adp->hasDecodedData()) + // note: a bad UUID will forever be !hasDecodedData() + // but also !hasValidData(), hence the check for hasValidData() + if (!adp->hasDecodedData() && adp->hasValidData()) { // This source is still waiting for a preload return true; diff --git a/linden/indra/llaudio/audioengine.h b/linden/indra/llaudio/audioengine.h index b582f14..76f1f95 100644 --- a/linden/indra/llaudio/audioengine.h +++ b/linden/indra/llaudio/audioengine.h @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/llaudio/audioengine_fmod.cpp b/linden/indra/llaudio/audioengine_fmod.cpp index 2197a45..938c2aa 100644 --- a/linden/indra/llaudio/audioengine_fmod.cpp +++ b/linden/indra/llaudio/audioengine_fmod.cpp @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, @@ -659,15 +660,12 @@ bool LLAudioBufferFMOD::loadWAV(const std::string& filename) return false; } - S32 file_size = 0; - apr_file_t* apr_file = ll_apr_file_open(filename, LL_APR_RPB, &file_size); - if (!apr_file) + if (!LLAPRFile::isExist(filename, NULL, LL_APR_RPB)) { // File not found, abort. return false; } - apr_file_close(apr_file); - + if (mSamplep) { // If there's already something loaded in this buffer, clean it up. diff --git a/linden/indra/llaudio/audioengine_fmod.h b/linden/indra/llaudio/audioengine_fmod.h index 4d2cbce..facbbb3 100644 --- a/linden/indra/llaudio/audioengine_fmod.h +++ b/linden/indra/llaudio/audioengine_fmod.h @@ -18,7 +18,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/llaudio/audioengine_openal.cpp b/linden/indra/llaudio/audioengine_openal.cpp index b33e0b0..244deec 100644 --- a/linden/indra/llaudio/audioengine_openal.cpp +++ b/linden/indra/llaudio/audioengine_openal.cpp @@ -18,7 +18,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/llaudio/audioengine_openal.h b/linden/indra/llaudio/audioengine_openal.h index 54b60e6..4997090 100644 --- a/linden/indra/llaudio/audioengine_openal.h +++ b/linden/indra/llaudio/audioengine_openal.h @@ -19,7 +19,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/llaudio/listener.cpp b/linden/indra/llaudio/listener.cpp index 9b99c5f..e2dc30e 100644 --- a/linden/indra/llaudio/listener.cpp +++ b/linden/indra/llaudio/listener.cpp @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/llaudio/listener.h b/linden/indra/llaudio/listener.h index 1c15e29..4137304 100644 --- a/linden/indra/llaudio/listener.h +++ b/linden/indra/llaudio/listener.h @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/llaudio/listener_ds3d.h b/linden/indra/llaudio/listener_ds3d.h index e58f3ff..3121e12 100644 --- a/linden/indra/llaudio/listener_ds3d.h +++ b/linden/indra/llaudio/listener_ds3d.h @@ -18,7 +18,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/llaudio/listener_fmod.cpp b/linden/indra/llaudio/listener_fmod.cpp index eca3547..4bbb3d9 100644 --- a/linden/indra/llaudio/listener_fmod.cpp +++ b/linden/indra/llaudio/listener_fmod.cpp @@ -18,7 +18,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/llaudio/listener_fmod.h b/linden/indra/llaudio/listener_fmod.h index 6ac8f20..5f372ab 100644 --- a/linden/indra/llaudio/listener_fmod.h +++ b/linden/indra/llaudio/listener_fmod.h @@ -18,7 +18,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/llaudio/listener_openal.cpp b/linden/indra/llaudio/listener_openal.cpp index 718de63..b7d75ec 100644 --- a/linden/indra/llaudio/listener_openal.cpp +++ b/linden/indra/llaudio/listener_openal.cpp @@ -18,7 +18,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/llaudio/listener_openal.h b/linden/indra/llaudio/listener_openal.h index 3e4353f..790dca2 100644 --- a/linden/indra/llaudio/listener_openal.h +++ b/linden/indra/llaudio/listener_openal.h @@ -18,7 +18,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/llaudio/llaudiodecodemgr.cpp b/linden/indra/llaudio/llaudiodecodemgr.cpp index 0515648..5b6db3b 100644 --- a/linden/indra/llaudio/llaudiodecodemgr.cpp +++ b/linden/indra/llaudio/llaudiodecodemgr.cpp @@ -16,7 +16,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/llaudio/llaudiodecodemgr.h b/linden/indra/llaudio/llaudiodecodemgr.h index fa6dbd8..040506c 100644 --- a/linden/indra/llaudio/llaudiodecodemgr.h +++ b/linden/indra/llaudio/llaudiodecodemgr.h @@ -16,7 +16,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/llaudio/vorbisdecode.cpp b/linden/indra/llaudio/vorbisdecode.cpp index 85c4b16..4bf70f4 100644 --- a/linden/indra/llaudio/vorbisdecode.cpp +++ b/linden/indra/llaudio/vorbisdecode.cpp @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, @@ -131,8 +132,12 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname) llwarning("unable to open vorbis source vfile for reading",0); return(FALSE); } - apr_file_t* outfp = ll_apr_file_open(out_fname,LL_APR_WPB); - if (!outfp) + + //********************************** + LLAPRFile outfile ; + outfile.open(out_fname,LL_APR_WPB); + //********************************** + if (!outfile.getFileHandle()) { llwarning("unable to open vorbis destination file for writing",0); return(FALSE); @@ -211,8 +216,7 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname) temp[42] = 0x00; temp[43] = 0x00; - - ll_apr_file_write(outfp, temp, 44); + outfile.write(temp, 44); } OggVorbis_File vf; @@ -222,7 +226,7 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname) int r = ov_open_callbacks(in_vfile, &vf, NULL, 0, vfs_callbacks); if(r < 0) { - llwarns << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << in_uuid << llendl; + llwarns << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << in_uuid << llendl; return(FALSE); } @@ -254,20 +258,20 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname) // llinfos << "Vorbis read " << ret << "bytes" << llendl; /* we don't bother dealing with sample rate changes, etc, but. you'll have to*/ - data_length += ll_apr_file_write(outfp, pcmout, ret); + data_length += outfile.write(pcmout, ret); } } ov_clear(&vf); // write "data" chunk length - ll_apr_file_seek(outfp,APR_SET,40); - ll_apr_file_write(outfp,&data_length,4); + outfile.seek(APR_SET,40); + outfile.write(&data_length,4); // write overall "RIFF" length data_length += 36; - ll_apr_file_seek(outfp,APR_SET,4); - ll_apr_file_write(outfp,&data_length,1*4); + outfile.seek(APR_SET,4); + outfile.write(&data_length,1*4); // FUCK!!! Vorbis encode/decode messes up loop point transitions (pop) // do a cheap-and-cheesy crossfade @@ -279,8 +283,8 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname) fade_length = llmin((S32)128,(S32)(data_length-36)/8); - ll_apr_file_seek(outfp,APR_SET,44); - ll_apr_file_read(outfp, pcmout,2*fade_length); //read first 16 samples + outfile.seek(APR_SET,44); + outfile.read(pcmout,2*fade_length); //read first 16 samples samplep = (S16 *)pcmout; @@ -289,11 +293,11 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname) *samplep++ = ((F32)*samplep * ((F32)i/(F32)fade_length)); } - ll_apr_file_seek(outfp,APR_SET,44); - ll_apr_file_write(outfp,pcmout,2*fade_length); //write back xfaded first 16 samples + outfile.seek(APR_SET,44); + outfile.write(pcmout,2*fade_length); //write back xfaded first 16 samples - ll_apr_file_seek(outfp,APR_END,-fade_length*2); - ll_apr_file_read(outfp, pcmout,2*fade_length); //read last 16 samples + outfile.seek(APR_END,-fade_length*2); + outfile.read(pcmout,2*fade_length); //read last 16 samples samplep = (S16 *)pcmout; @@ -302,11 +306,12 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname) *samplep++ = ((F32)*samplep * ((F32)i/(F32)fade_length)); } - ll_apr_file_seek(outfp,SEEK_END,-fade_length*2); - ll_apr_file_write(outfp,pcmout,2*fade_length); //write back xfaded last 16 samples - - apr_file_close(outfp); - + outfile.seek(SEEK_END,-fade_length*2); + outfile.write(pcmout,2*fade_length); //write back xfaded last 16 samples + //******************* + outfile.close(); + //******************* + if ((36 == data_length) || (!(eof))) { llwarning("BAD Vorbis DECODE!, removing .wav!",0); diff --git a/linden/indra/llaudio/vorbisdecode.h b/linden/indra/llaudio/vorbisdecode.h index e130c85..cb67c99 100644 --- a/linden/indra/llaudio/vorbisdecode.h +++ b/linden/indra/llaudio/vorbisdecode.h @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/llaudio/vorbisencode.cpp b/linden/indra/llaudio/vorbisencode.cpp index c5a751e..7df1416 100644 --- a/linden/indra/llaudio/vorbisencode.cpp +++ b/linden/indra/llaudio/vorbisencode.cpp @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, @@ -85,28 +86,29 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro error_msg.clear(); - apr_file_t* infp = ll_apr_file_open(in_fname,LL_APR_RB); - if (!infp) + //******************************** + LLAPRFile infile ; + infile.open(in_fname,LL_APR_RB); + //******************************** + if (!infile.getFileHandle()) { error_msg = "CannotUploadSoundFile"; return(LLVORBISENC_SOURCE_OPEN_ERR); } - ll_apr_file_read(infp, wav_header, 44); - physical_file_size = ll_apr_file_seek(infp,APR_END,0); + infile.read(wav_header, 44); + physical_file_size = infile.seek(APR_END,0); if (strncmp((char *)&(wav_header[0]),"RIFF",4)) { error_msg = "SoundFileNotRIFF"; - apr_file_close(infp); - return(LLVORBISENC_WAV_FORMAT_ERR); + return(LLVORBISENC_WAV_FORMAT_ERR); } if (strncmp((char *)&(wav_header[8]),"WAVE",4)) { error_msg = "SoundFileNotRIFF"; - apr_file_close(infp); - return(LLVORBISENC_WAV_FORMAT_ERR); + return(LLVORBISENC_WAV_FORMAT_ERR); } // parse the chunks @@ -115,8 +117,8 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro while ((file_pos + 8)< physical_file_size) { - ll_apr_file_seek(infp,APR_SET,file_pos); - ll_apr_file_read(infp, wav_header, 44); + infile.seek(APR_SET,file_pos); + infile.read(wav_header, 44); chunk_length = ((U32) wav_header[7] << 24) + ((U32) wav_header[6] << 16) @@ -149,8 +151,9 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro file_pos += (chunk_length + 8); chunk_length = 0; } - - apr_file_close(infp); + //**************** + infile.close(); + //**************** if (!uncompressed_pcm) { @@ -228,19 +231,21 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname S32 data_left = 0; - apr_file_t* infp = ll_apr_file_open(in_fname,LL_APR_RB); - if (!infp) + LLAPRFile infile ; + infile.open(in_fname,LL_APR_RB); + if (!infile.getFileHandle()) { llwarns << "Couldn't open temporary ogg file for writing: " << in_fname << llendl; return(LLVORBISENC_SOURCE_OPEN_ERR); } - apr_file_t* outfp = ll_apr_file_open(out_fname,LL_APR_WPB); - if (!outfp) + + LLAPRFile outfile ; + outfile.open(out_fname,LL_APR_WPB); + if (!outfile.getFileHandle()) { llwarns << "Couldn't open upload sound file for reading: " << in_fname << llendl; - apr_file_close (infp); return(LLVORBISENC_DEST_OPEN_ERR); } @@ -248,10 +253,10 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname U32 chunk_length = 0; U32 file_pos = 12; // start at the first chunk (usually fmt but not always) - while (apr_file_eof(infp) != APR_EOF) + while (infile.eof() != APR_EOF) { - ll_apr_file_seek(infp,APR_SET,file_pos); - ll_apr_file_read(infp, wav_header, 44); + infile.seek(APR_SET,file_pos); + infile.read(wav_header, 44); chunk_length = ((U32) wav_header[7] << 24) + ((U32) wav_header[6] << 16) @@ -271,7 +276,7 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname } else if (!(strncmp((char *)&(wav_header[0]),"data",4))) { - ll_apr_file_seek(infp,APR_SET,file_pos+8); + infile.seek(APR_SET,file_pos+8); // leave the file pointer at the beginning of the data chunk data data_left = chunk_length; break; @@ -280,7 +285,6 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname chunk_length = 0; } -// apr_file_close(infp); /********** Encode setup ************/ @@ -345,8 +349,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname while(!eos){ int result=ogg_stream_flush(&os,&og); if(result==0)break; - ll_apr_file_write(outfp, og.header, og.header_len); - ll_apr_file_write(outfp, og.body, og.body_len); + outfile.write(og.header, og.header_len); + outfile.write(og.body, og.body_len); } } @@ -356,7 +360,7 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname { long bytes_per_sample = bits_per_sample/8; - long bytes=(long)ll_apr_file_read(infp, readbuffer,llclamp((S32)(READ_BUFFER*num_channels*bytes_per_sample),0,data_left)); /* stereo hardwired here */ + long bytes=(long)infile.read(readbuffer,llclamp((S32)(READ_BUFFER*num_channels*bytes_per_sample),0,data_left)); /* stereo hardwired here */ if (bytes==0) { @@ -464,8 +468,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname if(result==0) break; - ll_apr_file_write(outfp, og.header, og.header_len); - ll_apr_file_write(outfp, og.body, og.body_len); + outfile.write(og.header, og.header_len); + outfile.write(og.body, og.body_len); /* this could be set above, but for illustrative purposes, I do it here (to show that vorbis does know where the stream ends) */ @@ -493,8 +497,6 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname // fprintf(stderr,"Vorbis encoding: Done.\n"); llinfos << "Vorbis encoding: Done." << llendl; - apr_file_close(outfp); - apr_file_close(infp); #endif return(LLVORBISENC_NOERR); diff --git a/linden/indra/llaudio/vorbisencode.h b/linden/indra/llaudio/vorbisencode.h index eadfa7d..ff5ce3a 100644 --- a/linden/indra/llaudio/vorbisencode.h +++ b/linden/indra/llaudio/vorbisencode.h @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/linden/indra/llaudio/windgen.h b/linden/indra/llaudio/windgen.h index faffd3c..847bfa6 100644 --- a/linden/indra/llaudio/windgen.h +++ b/linden/indra/llaudio/windgen.h @@ -17,7 +17,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, -- cgit v1.1