-
-/*
-=================================================================
-
- DLL load & unload
-
-=================================================================
-*/
-
-/*
-====================
-OGG_OpenLibrary
-
-Try to load the VorbisFile DLL
-====================
-*/
-qboolean OGG_OpenLibrary (void)
-{
- const char* dllname;
- const dllfunction_t *func;
-
- // Already loaded?
- if (vf_dll)
- return true;
-
-#ifdef WIN32
- dllname = "vorbisfile.dll";
-#else
- dllname = "libvorbisfile.so";
-#endif
-
- // Initializations
- for (func = oggvorbisfuncs; func && func->name != NULL; func++)
- *func->funcvariable = NULL;
-
- // Load the DLL
- if (! (vf_dll = Sys_LoadLibrary (dllname)))
- {
- Con_DPrintf("Can't find %s. Ogg Vorbis support disabled\n", dllname);
- return false;
- }
-
- // Get the function adresses
- for (func = oggvorbisfuncs; func && func->name != NULL; func++)
- if (!(*func->funcvariable = (void *) Sys_GetProcAddress (vf_dll, func->name)))
- {
- Con_Printf("missing function \"%s\" - broken Ogg Vorbis library!\n", func->name);
- OGG_CloseLibrary ();
- return false;
- }
-
- Con_DPrintf("%s loaded. Ogg Vorbis support enabled\n", dllname);
- return true;
-}
-
-
-/*
-====================
-OGG_CloseLibrary
-
-Unload the VorbisFile DLL
-====================
-*/
-void OGG_CloseLibrary (void)
-{
- if (!vf_dll)
- return;
-
- Sys_UnloadLibrary (vf_dll);
- vf_dll = NULL;
-}
-
-
-/*
-=================================================================
-
- 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)];
-
-