shithub: choc

Download patch

ref: 9c480b1cb18544240f433f90fca7e489eae35aff
parent: 5616ae0648ae9e11b3d9f4c889adecf0e6628a99
author: Simon Howard <[email protected]>
date: Fri Oct 24 15:48:01 EDT 2014

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.

--- a/src/i_sdlmusic.c
+++ b/src/i_sdlmusic.c
@@ -405,6 +405,13 @@
 
     // 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