mirror of https://github.com/ppy/osu
Do not attempt to pass files that don't look like audio to BASS
This commit is contained in:
parent
b28bf4d2ec
commit
70a5288a68
|
@ -37,14 +37,16 @@ public IEnumerable<Issue> Run(BeatmapVerifierContext context)
|
|||
if (data == null)
|
||||
continue;
|
||||
|
||||
if (!AudioCheckUtils.HasAudioExtension(file.Filename) || !probablyHasAudioData(data))
|
||||
continue;
|
||||
|
||||
var fileCallbacks = new FileCallbacks(new DataStreamFileProcedures(data));
|
||||
int decodeStream = Bass.CreateStream(StreamSystem.NoBuffer, BassFlags.Decode, fileCallbacks.Callbacks, fileCallbacks.Handle);
|
||||
|
||||
// If the format is not supported by BASS
|
||||
if (decodeStream == 0)
|
||||
{
|
||||
if (AudioCheckUtils.HasAudioExtension(file.Filename) && probablyHasAudioData(data))
|
||||
yield return new IssueTemplateFormatUnsupported(this).Create(file.Filename);
|
||||
yield return new IssueTemplateFormatUnsupported(this).Create(file.Filename);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue