aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llaudio
diff options
context:
space:
mode:
authorJacek Antonelli2009-04-30 13:04:20 -0500
committerJacek Antonelli2009-04-30 13:07:16 -0500
commitca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch)
tree8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/llaudio
parentSecond Life viewer sources 1.22.11 (diff)
downloadmeta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz
Second Life viewer sources 1.23.0-RC
Diffstat (limited to 'linden/indra/llaudio')
-rw-r--r--linden/indra/llaudio/audioengine.cpp13
-rw-r--r--linden/indra/llaudio/audioengine.h3
-rw-r--r--linden/indra/llaudio/audioengine_fmod.cpp10
-rw-r--r--linden/indra/llaudio/audioengine_fmod.h3
-rw-r--r--linden/indra/llaudio/audioengine_openal.cpp3
-rw-r--r--linden/indra/llaudio/audioengine_openal.h3
-rw-r--r--linden/indra/llaudio/listener.cpp3
-rw-r--r--linden/indra/llaudio/listener.h3
-rw-r--r--linden/indra/llaudio/listener_ds3d.h3
-rw-r--r--linden/indra/llaudio/listener_fmod.cpp3
-rw-r--r--linden/indra/llaudio/listener_fmod.h3
-rw-r--r--linden/indra/llaudio/listener_openal.cpp3
-rw-r--r--linden/indra/llaudio/listener_openal.h3
-rw-r--r--linden/indra/llaudio/llaudiodecodemgr.cpp3
-rw-r--r--linden/indra/llaudio/llaudiodecodemgr.h3
-rw-r--r--linden/indra/llaudio/vorbisdecode.cpp49
-rw-r--r--linden/indra/llaudio/vorbisdecode.h3
-rw-r--r--linden/indra/llaudio/vorbisencode.cpp62
-rw-r--r--linden/indra/llaudio/vorbisencode.h3
-rw-r--r--linden/indra/llaudio/windgen.h3
20 files changed, 103 insertions, 79 deletions
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 @@
18 * There are special exceptions to the terms and conditions of the GPL as 18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception 19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or 20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 * 23 *
23 * By copying, modifying or distributing this software, you acknowledge 24 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above, 25 * that you have read and understood your obligations described above,
@@ -96,11 +97,11 @@ void LLAudioEngine::setDefaults()
96 mInternetStreamGain = 0.125f; 97 mInternetStreamGain = 0.125f;
97 mNextWindUpdate = 0.f; 98 mNextWindUpdate = 0.f;
98 99
99 for (U32 i = 0; i < LLAudioEngine::AUDIO_TYPE_COUNT; i++)
100 mSecondaryGain[i] = 1.0f;
101
102 mInternetStreamMedia = NULL; 100 mInternetStreamMedia = NULL;
103 mInternetStreamURL.clear(); 101 mInternetStreamURL.clear();
102
103 for (U32 i = 0; i < LLAudioEngine::AUDIO_TYPE_COUNT; i++)
104 mSecondaryGain[i] = 1.0f;
104} 105}
105 106
106 107
@@ -1624,7 +1625,9 @@ bool LLAudioSource::hasPendingPreloads() const
1624 for (iter = mPreloadMap.begin(); iter != mPreloadMap.end(); iter++) 1625 for (iter = mPreloadMap.begin(); iter != mPreloadMap.end(); iter++)
1625 { 1626 {
1626 LLAudioData *adp = iter->second; 1627 LLAudioData *adp = iter->second;
1627 if (!adp->hasDecodedData()) 1628 // note: a bad UUID will forever be !hasDecodedData()
1629 // but also !hasValidData(), hence the check for hasValidData()
1630 if (!adp->hasDecodedData() && adp->hasValidData())
1628 { 1631 {
1629 // This source is still waiting for a preload 1632 // This source is still waiting for a preload
1630 return true; 1633 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 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * 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 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -659,15 +660,12 @@ bool LLAudioBufferFMOD::loadWAV(const std::string& filename)
659 return false; 660 return false;
660 } 661 }
661 662
662 S32 file_size = 0; 663 if (!LLAPRFile::isExist(filename, NULL, LL_APR_RPB))
663 apr_file_t* apr_file = ll_apr_file_open(filename, LL_APR_RPB, &file_size);
664 if (!apr_file)
665 { 664 {
666 // File not found, abort. 665 // File not found, abort.
667 return false; 666 return false;
668 } 667 }
669 apr_file_close(apr_file); 668
670
671 if (mSamplep) 669 if (mSamplep)
672 { 670 {
673 // If there's already something loaded in this buffer, clean it up. 671 // 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 @@
18 * There are special exceptions to the terms and conditions of the GPL as 18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception 19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or 20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 * 23 *
23 * By copying, modifying or distributing this software, you acknowledge 24 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above, 25 * 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 @@
18 * There are special exceptions to the terms and conditions of the GPL as 18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception 19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or 20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 * 23 *
23 * By copying, modifying or distributing this software, you acknowledge 24 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above, 25 * 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 @@
19 * There are special exceptions to the terms and conditions of the GPL as 19 * There are special exceptions to the terms and conditions of the GPL as
20 * it is applied to this Source Code. View the full text of the exception 20 * it is applied to this Source Code. View the full text of the exception
21 * in the file doc/FLOSS-exception.txt in this software distribution, or 21 * in the file doc/FLOSS-exception.txt in this software distribution, or
22 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 22 * online at
23 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
23 * 24 *
24 * By copying, modifying or distributing this software, you acknowledge 25 * By copying, modifying or distributing this software, you acknowledge
25 * that you have read and understood your obligations described above, 26 * 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 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * 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 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * 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 @@
18 * There are special exceptions to the terms and conditions of the GPL as 18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception 19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or 20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 * 23 *
23 * By copying, modifying or distributing this software, you acknowledge 24 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above, 25 * 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 @@
18 * There are special exceptions to the terms and conditions of the GPL as 18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception 19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or 20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 * 23 *
23 * By copying, modifying or distributing this software, you acknowledge 24 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above, 25 * 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 @@
18 * There are special exceptions to the terms and conditions of the GPL as 18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception 19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or 20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 * 23 *
23 * By copying, modifying or distributing this software, you acknowledge 24 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above, 25 * 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 @@
18 * There are special exceptions to the terms and conditions of the GPL as 18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception 19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or 20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 * 23 *
23 * By copying, modifying or distributing this software, you acknowledge 24 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above, 25 * 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 @@
18 * There are special exceptions to the terms and conditions of the GPL as 18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception 19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or 20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 * 23 *
23 * By copying, modifying or distributing this software, you acknowledge 24 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above, 25 * 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 @@
16 * There are special exceptions to the terms and conditions of the GPL as 16 * There are special exceptions to the terms and conditions of the GPL as
17 * it is applied to this Source Code. View the full text of the exception 17 * it is applied to this Source Code. View the full text of the exception
18 * in the file doc/FLOSS-exception.txt in this software distribution, or 18 * in the file doc/FLOSS-exception.txt in this software distribution, or
19 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 19 * online at
20 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
20 * 21 *
21 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
22 * that you have read and understood your obligations described above, 23 * 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 @@
16 * There are special exceptions to the terms and conditions of the GPL as 16 * There are special exceptions to the terms and conditions of the GPL as
17 * it is applied to this Source Code. View the full text of the exception 17 * it is applied to this Source Code. View the full text of the exception
18 * in the file doc/FLOSS-exception.txt in this software distribution, or 18 * in the file doc/FLOSS-exception.txt in this software distribution, or
19 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 19 * online at
20 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
20 * 21 *
21 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
22 * that you have read and understood your obligations described above, 23 * 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 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * 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)
131 llwarning("unable to open vorbis source vfile for reading",0); 132 llwarning("unable to open vorbis source vfile for reading",0);
132 return(FALSE); 133 return(FALSE);
133 } 134 }
134 apr_file_t* outfp = ll_apr_file_open(out_fname,LL_APR_WPB); 135
135 if (!outfp) 136 //**********************************
137 LLAPRFile outfile ;
138 outfile.open(out_fname,LL_APR_WPB);
139 //**********************************
140 if (!outfile.getFileHandle())
136 { 141 {
137 llwarning("unable to open vorbis destination file for writing",0); 142 llwarning("unable to open vorbis destination file for writing",0);
138 return(FALSE); 143 return(FALSE);
@@ -211,8 +216,7 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname)
211 temp[42] = 0x00; 216 temp[42] = 0x00;
212 temp[43] = 0x00; 217 temp[43] = 0x00;
213 218
214 219 outfile.write(temp, 44);
215 ll_apr_file_write(outfp, temp, 44);
216 } 220 }
217 221
218 OggVorbis_File vf; 222 OggVorbis_File vf;
@@ -222,7 +226,7 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname)
222 int r = ov_open_callbacks(in_vfile, &vf, NULL, 0, vfs_callbacks); 226 int r = ov_open_callbacks(in_vfile, &vf, NULL, 0, vfs_callbacks);
223 if(r < 0) 227 if(r < 0)
224 { 228 {
225 llwarns << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << in_uuid << llendl; 229 llwarns << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << in_uuid << llendl;
226 return(FALSE); 230 return(FALSE);
227 } 231 }
228 232
@@ -254,20 +258,20 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname)
254// llinfos << "Vorbis read " << ret << "bytes" << llendl; 258// llinfos << "Vorbis read " << ret << "bytes" << llendl;
255 /* we don't bother dealing with sample rate changes, etc, but. 259 /* we don't bother dealing with sample rate changes, etc, but.
256 you'll have to*/ 260 you'll have to*/
257 data_length += ll_apr_file_write(outfp, pcmout, ret); 261 data_length += outfile.write(pcmout, ret);
258 } 262 }
259 } 263 }
260 264
261 ov_clear(&vf); 265 ov_clear(&vf);
262 266
263 // write "data" chunk length 267 // write "data" chunk length
264 ll_apr_file_seek(outfp,APR_SET,40); 268 outfile.seek(APR_SET,40);
265 ll_apr_file_write(outfp,&data_length,4); 269 outfile.write(&data_length,4);
266 270
267 // write overall "RIFF" length 271 // write overall "RIFF" length
268 data_length += 36; 272 data_length += 36;
269 ll_apr_file_seek(outfp,APR_SET,4); 273 outfile.seek(APR_SET,4);
270 ll_apr_file_write(outfp,&data_length,1*4); 274 outfile.write(&data_length,1*4);
271 275
272 // FUCK!!! Vorbis encode/decode messes up loop point transitions (pop) 276 // FUCK!!! Vorbis encode/decode messes up loop point transitions (pop)
273 // do a cheap-and-cheesy crossfade 277 // do a cheap-and-cheesy crossfade
@@ -279,8 +283,8 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname)
279 283
280 fade_length = llmin((S32)128,(S32)(data_length-36)/8); 284 fade_length = llmin((S32)128,(S32)(data_length-36)/8);
281 285
282 ll_apr_file_seek(outfp,APR_SET,44); 286 outfile.seek(APR_SET,44);
283 ll_apr_file_read(outfp, pcmout,2*fade_length); //read first 16 samples 287 outfile.read(pcmout,2*fade_length); //read first 16 samples
284 288
285 samplep = (S16 *)pcmout; 289 samplep = (S16 *)pcmout;
286 290
@@ -289,11 +293,11 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname)
289 *samplep++ = ((F32)*samplep * ((F32)i/(F32)fade_length)); 293 *samplep++ = ((F32)*samplep * ((F32)i/(F32)fade_length));
290 } 294 }
291 295
292 ll_apr_file_seek(outfp,APR_SET,44); 296 outfile.seek(APR_SET,44);
293 ll_apr_file_write(outfp,pcmout,2*fade_length); //write back xfaded first 16 samples 297 outfile.write(pcmout,2*fade_length); //write back xfaded first 16 samples
294 298
295 ll_apr_file_seek(outfp,APR_END,-fade_length*2); 299 outfile.seek(APR_END,-fade_length*2);
296 ll_apr_file_read(outfp, pcmout,2*fade_length); //read last 16 samples 300 outfile.read(pcmout,2*fade_length); //read last 16 samples
297 301
298 samplep = (S16 *)pcmout; 302 samplep = (S16 *)pcmout;
299 303
@@ -302,11 +306,12 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname)
302 *samplep++ = ((F32)*samplep * ((F32)i/(F32)fade_length)); 306 *samplep++ = ((F32)*samplep * ((F32)i/(F32)fade_length));
303 } 307 }
304 308
305 ll_apr_file_seek(outfp,SEEK_END,-fade_length*2); 309 outfile.seek(SEEK_END,-fade_length*2);
306 ll_apr_file_write(outfp,pcmout,2*fade_length); //write back xfaded last 16 samples 310 outfile.write(pcmout,2*fade_length); //write back xfaded last 16 samples
307 311 //*******************
308 apr_file_close(outfp); 312 outfile.close();
309 313 //*******************
314
310 if ((36 == data_length) || (!(eof))) 315 if ((36 == data_length) || (!(eof)))
311 { 316 {
312 llwarning("BAD Vorbis DECODE!, removing .wav!",0); 317 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 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * 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 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * 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
85 86
86 error_msg.clear(); 87 error_msg.clear();
87 88
88 apr_file_t* infp = ll_apr_file_open(in_fname,LL_APR_RB); 89 //********************************
89 if (!infp) 90 LLAPRFile infile ;
91 infile.open(in_fname,LL_APR_RB);
92 //********************************
93 if (!infile.getFileHandle())
90 { 94 {
91 error_msg = "CannotUploadSoundFile"; 95 error_msg = "CannotUploadSoundFile";
92 return(LLVORBISENC_SOURCE_OPEN_ERR); 96 return(LLVORBISENC_SOURCE_OPEN_ERR);
93 } 97 }
94 98
95 ll_apr_file_read(infp, wav_header, 44); 99 infile.read(wav_header, 44);
96 physical_file_size = ll_apr_file_seek(infp,APR_END,0); 100 physical_file_size = infile.seek(APR_END,0);
97 101
98 if (strncmp((char *)&(wav_header[0]),"RIFF",4)) 102 if (strncmp((char *)&(wav_header[0]),"RIFF",4))
99 { 103 {
100 error_msg = "SoundFileNotRIFF"; 104 error_msg = "SoundFileNotRIFF";
101 apr_file_close(infp); 105 return(LLVORBISENC_WAV_FORMAT_ERR);
102 return(LLVORBISENC_WAV_FORMAT_ERR);
103 } 106 }
104 107
105 if (strncmp((char *)&(wav_header[8]),"WAVE",4)) 108 if (strncmp((char *)&(wav_header[8]),"WAVE",4))
106 { 109 {
107 error_msg = "SoundFileNotRIFF"; 110 error_msg = "SoundFileNotRIFF";
108 apr_file_close(infp); 111 return(LLVORBISENC_WAV_FORMAT_ERR);
109 return(LLVORBISENC_WAV_FORMAT_ERR);
110 } 112 }
111 113
112 // parse the chunks 114 // parse the chunks
@@ -115,8 +117,8 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
115 117
116 while ((file_pos + 8)< physical_file_size) 118 while ((file_pos + 8)< physical_file_size)
117 { 119 {
118 ll_apr_file_seek(infp,APR_SET,file_pos); 120 infile.seek(APR_SET,file_pos);
119 ll_apr_file_read(infp, wav_header, 44); 121 infile.read(wav_header, 44);
120 122
121 chunk_length = ((U32) wav_header[7] << 24) 123 chunk_length = ((U32) wav_header[7] << 24)
122 + ((U32) wav_header[6] << 16) 124 + ((U32) wav_header[6] << 16)
@@ -149,8 +151,9 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
149 file_pos += (chunk_length + 8); 151 file_pos += (chunk_length + 8);
150 chunk_length = 0; 152 chunk_length = 0;
151 } 153 }
152 154 //****************
153 apr_file_close(infp); 155 infile.close();
156 //****************
154 157
155 if (!uncompressed_pcm) 158 if (!uncompressed_pcm)
156 { 159 {
@@ -228,19 +231,21 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
228 231
229 S32 data_left = 0; 232 S32 data_left = 0;
230 233
231 apr_file_t* infp = ll_apr_file_open(in_fname,LL_APR_RB); 234 LLAPRFile infile ;
232 if (!infp) 235 infile.open(in_fname,LL_APR_RB);
236 if (!infile.getFileHandle())
233 { 237 {
234 llwarns << "Couldn't open temporary ogg file for writing: " << in_fname 238 llwarns << "Couldn't open temporary ogg file for writing: " << in_fname
235 << llendl; 239 << llendl;
236 return(LLVORBISENC_SOURCE_OPEN_ERR); 240 return(LLVORBISENC_SOURCE_OPEN_ERR);
237 } 241 }
238 apr_file_t* outfp = ll_apr_file_open(out_fname,LL_APR_WPB); 242
239 if (!outfp) 243 LLAPRFile outfile ;
244 outfile.open(out_fname,LL_APR_WPB);
245 if (!outfile.getFileHandle())
240 { 246 {
241 llwarns << "Couldn't open upload sound file for reading: " << in_fname 247 llwarns << "Couldn't open upload sound file for reading: " << in_fname
242 << llendl; 248 << llendl;
243 apr_file_close (infp);
244 return(LLVORBISENC_DEST_OPEN_ERR); 249 return(LLVORBISENC_DEST_OPEN_ERR);
245 } 250 }
246 251
@@ -248,10 +253,10 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
248 U32 chunk_length = 0; 253 U32 chunk_length = 0;
249 U32 file_pos = 12; // start at the first chunk (usually fmt but not always) 254 U32 file_pos = 12; // start at the first chunk (usually fmt but not always)
250 255
251 while (apr_file_eof(infp) != APR_EOF) 256 while (infile.eof() != APR_EOF)
252 { 257 {
253 ll_apr_file_seek(infp,APR_SET,file_pos); 258 infile.seek(APR_SET,file_pos);
254 ll_apr_file_read(infp, wav_header, 44); 259 infile.read(wav_header, 44);
255 260
256 chunk_length = ((U32) wav_header[7] << 24) 261 chunk_length = ((U32) wav_header[7] << 24)
257 + ((U32) wav_header[6] << 16) 262 + ((U32) wav_header[6] << 16)
@@ -271,7 +276,7 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
271 } 276 }
272 else if (!(strncmp((char *)&(wav_header[0]),"data",4))) 277 else if (!(strncmp((char *)&(wav_header[0]),"data",4)))
273 { 278 {
274 ll_apr_file_seek(infp,APR_SET,file_pos+8); 279 infile.seek(APR_SET,file_pos+8);
275 // leave the file pointer at the beginning of the data chunk data 280 // leave the file pointer at the beginning of the data chunk data
276 data_left = chunk_length; 281 data_left = chunk_length;
277 break; 282 break;
@@ -280,7 +285,6 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
280 chunk_length = 0; 285 chunk_length = 0;
281 } 286 }
282 287
283// apr_file_close(infp);
284 288
285 /********** Encode setup ************/ 289 /********** Encode setup ************/
286 290
@@ -345,8 +349,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
345 while(!eos){ 349 while(!eos){
346 int result=ogg_stream_flush(&os,&og); 350 int result=ogg_stream_flush(&os,&og);
347 if(result==0)break; 351 if(result==0)break;
348 ll_apr_file_write(outfp, og.header, og.header_len); 352 outfile.write(og.header, og.header_len);
349 ll_apr_file_write(outfp, og.body, og.body_len); 353 outfile.write(og.body, og.body_len);
350 } 354 }
351 355
352 } 356 }
@@ -356,7 +360,7 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
356 { 360 {
357 long bytes_per_sample = bits_per_sample/8; 361 long bytes_per_sample = bits_per_sample/8;
358 362
359 long bytes=(long)ll_apr_file_read(infp, readbuffer,llclamp((S32)(READ_BUFFER*num_channels*bytes_per_sample),0,data_left)); /* stereo hardwired here */ 363 long bytes=(long)infile.read(readbuffer,llclamp((S32)(READ_BUFFER*num_channels*bytes_per_sample),0,data_left)); /* stereo hardwired here */
360 364
361 if (bytes==0) 365 if (bytes==0)
362 { 366 {
@@ -464,8 +468,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
464 if(result==0) 468 if(result==0)
465 break; 469 break;
466 470
467 ll_apr_file_write(outfp, og.header, og.header_len); 471 outfile.write(og.header, og.header_len);
468 ll_apr_file_write(outfp, og.body, og.body_len); 472 outfile.write(og.body, og.body_len);
469 473
470 /* this could be set above, but for illustrative purposes, I do 474 /* this could be set above, but for illustrative purposes, I do
471 it here (to show that vorbis does know where the stream ends) */ 475 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
493 497
494// fprintf(stderr,"Vorbis encoding: Done.\n"); 498// fprintf(stderr,"Vorbis encoding: Done.\n");
495 llinfos << "Vorbis encoding: Done." << llendl; 499 llinfos << "Vorbis encoding: Done." << llendl;
496 apr_file_close(outfp);
497 apr_file_close(infp);
498 500
499#endif 501#endif
500 return(LLVORBISENC_NOERR); 502 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 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * 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 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,