Procházet zdrojové kódy

miles is still broken, reinstate workaround

cxgeorge před 23 roky
rodič
revize
942f484326
1 změnil soubory, kde provedl 7 přidání a 4 odebrání
  1. 7 4
      panda/src/audiotraits/milesAudioSound.cxx

+ 7 - 4
panda/src/audiotraits/milesAudioSound.cxx

@@ -22,11 +22,7 @@
 #include "milesAudioSound.h"
 #include "milesAudioSound.h"
 #include "milesAudioManager.h"
 #include "milesAudioManager.h"
 
 
-#if (MSS_MAJOR_VERSION <= 6) && (MSS_MINOR_VERSION < 5)
 #define NEED_MILES_LENGTH_WORKAROUND
 #define NEED_MILES_LENGTH_WORKAROUND
-#endif
-
-//#define NEED_MILES_LENGTH_WORKAROUND
 
 
 #ifndef NDEBUG //[
 #ifndef NDEBUG //[
   namespace {
   namespace {
@@ -238,6 +234,9 @@ length() const {
   if (_length == 0.0f) {
   if (_length == 0.0f) {
    #ifndef NEED_MILES_LENGTH_WORKAROUND
    #ifndef NEED_MILES_LENGTH_WORKAROUND
         _length=((float)AIL_quick_ms_length(_audio))*0.001f;
         _length=((float)AIL_quick_ms_length(_audio))*0.001f;
+        if (_length == 0.0f) {
+            audio_error("ERROR: Miles returned length 0 for "<<_file_name << "!");
+        }
    #else
    #else
         // hack:
         // hack:
         // For now, the sound needs to be playing, in order to
         // For now, the sound needs to be playing, in order to
@@ -245,6 +244,10 @@ length() const {
         // sent them example code.  They've told me they're looking into it.
         // sent them example code.  They've told me they're looking into it.
         // Until then, we'll play the sound to get the length.
         // Until then, we'll play the sound to get the length.
 
 
+        // Miles 6.5c note:  seems to be fixed for .mid (but not 100% positive,
+        // we have noticed problems with midi not playing).
+        // definitely still not fixed for .mp3 files
+
         if (AIL_quick_status(_audio)==QSTAT_PLAYING) {
         if (AIL_quick_status(_audio)==QSTAT_PLAYING) {
           _length=((float)AIL_quick_ms_length(_audio))*0.001f;
           _length=((float)AIL_quick_ms_length(_audio))*0.001f;
         } else {
         } else {