]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_ogg.c
The portable_samplepair_t structure has no need to be public
[xonotic/darkplaces.git] / snd_ogg.c
index d1a44f267b621491ae273420279331e5e0e5be72..18c500f77942324c0f74da24068882abffa2ff68 100644 (file)
--- a/snd_ogg.c
+++ b/snd_ogg.c
@@ -24,6 +24,7 @@
 
 #include "quakedef.h"
 #include "snd_ogg.h"
+#include "snd_wav.h"
 
 
 /*
@@ -292,7 +293,6 @@ Try to load the VorbisFile DLL
 qboolean OGG_OpenLibrary (void)
 {
        const char* dllname;
-       const dllfunction_t *func;
 
        // Already loaded?
        if (vf_dll)
@@ -304,27 +304,14 @@ qboolean OGG_OpenLibrary (void)
        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)))
+       if (! Sys_LoadLibrary (dllname, &vf_dll, oggvorbisfuncs))
        {
-               Con_DPrintf("Can't find %s. Ogg Vorbis support disabled\n", dllname);
+               Con_Printf ("Ogg Vorbis support disabled\n");
                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);
+       Con_Printf ("Ogg Vorbis support enabled\n");
        return true;
 }
 
@@ -338,11 +325,7 @@ Unload the VorbisFile DLL
 */
 void OGG_CloseLibrary (void)
 {
-       if (!vf_dll)
-               return;
-
-       Sys_UnloadLibrary (vf_dll);
-       vf_dll = NULL;
+       Sys_UnloadLibrary (&vf_dll);
 }
 
 
@@ -500,7 +483,6 @@ static void OGG_FetchEnd (channel_t* ch)
 }
 
 static const snd_fetcher_t ogg_fetcher = { OGG_FetchSound, OGG_FetchEnd };
-extern snd_fetcher_t wav_fetcher;
 
 
 /*