Ensure a decent sample length.

Apparently some versions of DWI messed this up.

Thank (or blame) confuzled if this fails.
This commit is contained in:
Jason Felds
2013-05-20 17:47:58 -04:00
parent c04553846a
commit d2ea94648e
+9 -1
View File
@@ -632,7 +632,15 @@ bool DWILoader::LoadFromDir( const RString &sPath_, Song &out, set<RString> &Bla
out.m_fMusicSampleStartSeconds = ParseBrokenDWITimestamp(sParams[1], sParams[2], sParams[3]);
else if( sValueName.EqualsNoCase("SAMPLELENGTH") )
out.m_fMusicSampleLengthSeconds = ParseBrokenDWITimestamp(sParams[1], sParams[2], sParams[3]);
{
float sampleLength = ParseBrokenDWITimestamp(sParams[1], sParams[2], sParams[3]);
if (sampleLength > 0 && sampleLength < 1) {
// there were multiple versions of this tag allegedly: ensure a decent length if requested.
sampleLength *= 1000;
}
out.m_fMusicSampleLengthSeconds = sampleLength;
}
else if( sValueName.EqualsNoCase("FREEZE") )
{