diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llaudio/llvorbisencode.h (renamed from linden/indra/llaudio/vorbisencode.h) | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/linden/indra/llaudio/vorbisencode.h b/linden/indra/llaudio/llvorbisencode.h index ff5ce3a..2825a30 100644 --- a/linden/indra/llaudio/vorbisencode.h +++ b/linden/indra/llaudio/llvorbisencode.h | |||
@@ -45,6 +45,17 @@ const S32 LLVORBISENC_UNSUPPORTED_SAMPLE_RATE = 8; // unsupported sample ra | |||
45 | const S32 LLVORBISENC_UNSUPPORTED_WORD_SIZE = 9; // unsupported word size | 45 | const S32 LLVORBISENC_UNSUPPORTED_WORD_SIZE = 9; // unsupported word size |
46 | const S32 LLVORBISENC_CLIP_TOO_LONG = 10; // source file is too long | 46 | const S32 LLVORBISENC_CLIP_TOO_LONG = 10; // source file is too long |
47 | 47 | ||
48 | const F32 LLVORBIS_CLIP_MAX_TIME = 10.0f; | ||
49 | const U8 LLVORBIS_CLIP_MAX_CHANNELS = 2; | ||
50 | const U32 LLVORBIS_CLIP_SAMPLE_RATE = 44100; | ||
51 | const U32 LLVORBIS_CLIP_MAX_SAMPLES_PER_CHANNEL = (U32)(LLVORBIS_CLIP_MAX_TIME * LLVORBIS_CLIP_SAMPLE_RATE); | ||
52 | const U32 LLVORBIS_CLIP_MAX_SAMPLES = LLVORBIS_CLIP_MAX_SAMPLES_PER_CHANNEL * LLVORBIS_CLIP_MAX_CHANNELS; | ||
53 | const size_t LLVORBIS_CLIP_MAX_SAMPLE_DATA = LLVORBIS_CLIP_MAX_SAMPLES * 2; // 2 = 16-bit | ||
54 | |||
55 | // Treat anything this long as a bad asset. A little fudge factor at the end: | ||
56 | // Make that a lot of fudge factor. We're allowing 30 sec for now - 3x legal upload | ||
57 | const size_t LLVORBIS_CLIP_REJECT_SAMPLES = LLVORBIS_CLIP_MAX_SAMPLES * 3; | ||
58 | const size_t LLVORBIS_CLIP_REJECT_SIZE = LLVORBIS_CLIP_MAX_SAMPLE_DATA * 3; | ||
48 | 59 | ||
49 | S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& error_msg); | 60 | S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& error_msg); |
50 | S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname); | 61 | S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname); |