-
-/*
-=================================================================
-
- DLL load & unload
-
-=================================================================
-*/
-
-/*
-====================
-OGG_OpenLibrary
-
-Try to load the VorbisFile DLL
-====================
-*/
-qboolean OGG_OpenLibrary (void)
-{
- const char* dllname;
-
- // Already loaded?
- if (vf_dll)
- return true;
-
-#ifdef WIN32
- dllname = "vorbisfile.dll";
-#else
- dllname = "libvorbisfile.so";
-#endif
-
- // Load the DLL
- if (! Sys_LoadLibrary (dllname, &vf_dll, oggvorbisfuncs))
- {
- Con_Printf ("Ogg Vorbis support disabled\n");
- return false;
- }
-
- Con_Printf ("Ogg Vorbis support enabled\n");
- return true;
-}
-
-
-/*
-====================
-OGG_CloseLibrary
-
-Unload the VorbisFile DLL
-====================
-*/
-void OGG_CloseLibrary (void)
-{
- Sys_UnloadLibrary (&vf_dll);
-}
-
-
-/*
-=================================================================
-
- Ogg Vorbis decoding
-
-=================================================================
-*/
-
-#define STREAM_BUFFER_SIZE (128 * 1024)
-
-// Note: it must be able to contain enough samples at 48 KHz (max speed)
-// to fill STREAM_BUFFER_SIZE bytes of samples at 8 KHz (min speed)
-// TODO: dynamically allocate this buffer depending on the shm and min sound speeds
-static qbyte resampling_buffer [STREAM_BUFFER_SIZE * (48000 / 8000)];
-
-