Преглед на файлове

hack to protect FMOD from gs_instruments.dls

David Rose преди 19 години
родител
ревизия
8b1cdc6ece
променени са 1 файла, в които са добавени 9 реда и са изтрити 0 реда
  1. 9 0
      panda/src/audiotraits/fmodAudioManager.cxx

+ 9 - 0
panda/src/audiotraits/fmodAudioManager.cxx

@@ -157,6 +157,15 @@ FmodAudioManager() {
   _midi_info.cbsize = sizeof(_midi_info);
   _midi_info.cbsize = sizeof(_midi_info);
 
 
   Filename dls_pathname = get_dls_pathname();
   Filename dls_pathname = get_dls_pathname();
+
+#ifdef IS_OSX
+  // Here's a big kludge.  Don't ever let FMOD try to load this
+  // OSX-provided file; it crashes messily if you do.
+  if (dls_pathname == "/System/Library/Components/CoreAudio.component/Contents/Resources/gs_instruments.dls") {
+    dls_pathname = "";
+  }
+#endif  // IS_OSX
+
   if (!dls_pathname.empty()) {
   if (!dls_pathname.empty()) {
     _dlsname = dls_pathname.to_os_specific();
     _dlsname = dls_pathname.to_os_specific();
     _midi_info.dlsname = _dlsname.c_str();
     _midi_info.dlsname = _dlsname.c_str();