foxygit / doom Log in
commit 9c480b1cb18544240f433f90fca7e489eae35aff
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Fri Oct 24 19:48:01 2014 -0400
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Fri Oct 24 19:48:01 2014 -0400

    Ignore metadata loop tags if both are zero.

    If LOOP_START and LOOP_END are both set to zero, ignore them. This
    is consistent with other source ports.
---
 src/i_sdlmusic.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/i_sdlmusic.c b/src/i_sdlmusic.c
index 16c5d517..b8c2b2f7 100644
--- a/src/i_sdlmusic.c
+++ b/src/i_sdlmusic.c
@@ -405,6 +405,13 @@ static void ReadLoopPoints(char *filename, file_metadata_t *metadata)

     // Only valid if at the very least we read the sample rate.
     metadata->valid = metadata->samplerate_hz > 0;
+
+    // If start and end time are both zero, ignore the loop tags.
+    // This is consistent with other source ports.
+    if (metadata->start_time == 0 && metadata->end_time == 0)
+    {
+        metadata->valid = false;
+    }
 }

 // Given a MUS lump, look up a substitute MUS file to play instead