mirror of
https://github.com/ppy/osu.git
synced 2025-02-11 19:33:22 +08:00
Remove BassFlags.Prescan
and free the decodeStream
This commit is contained in:
parent
c32d99250f
commit
8d94f8d995
@ -47,7 +47,7 @@ namespace osu.Game.Rulesets.Edit.Checks
|
||||
continue;
|
||||
|
||||
var fileCallbacks = new FileCallbacks(new DataStreamFileProcedures(data));
|
||||
int decodeStream = Bass.CreateStream(StreamSystem.NoBuffer, BassFlags.Decode | BassFlags.Prescan, fileCallbacks.Callbacks, fileCallbacks.Handle);
|
||||
int decodeStream = Bass.CreateStream(StreamSystem.NoBuffer, BassFlags.Decode, fileCallbacks.Callbacks, fileCallbacks.Handle);
|
||||
|
||||
// If the format is not supported by BASS
|
||||
if (decodeStream == 0)
|
||||
@ -61,9 +61,10 @@ namespace osu.Game.Rulesets.Edit.Checks
|
||||
var audioInfo = Bass.ChannelGetInfo(decodeStream);
|
||||
|
||||
if (!allowedFormats.Contains(audioInfo.ChannelType))
|
||||
{
|
||||
yield return new IssueTemplateIncorrectFormat(this).Create(file.Filename, audioInfo.ChannelType.ToString());
|
||||
}
|
||||
|
||||
|
||||
Bass.StreamFree(decodeStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Edit.Checks
|
||||
if (data == null || data.Length <= 0) yield break;
|
||||
|
||||
var fileCallbacks = new FileCallbacks(new DataStreamFileProcedures(data));
|
||||
int decodeStream = Bass.CreateStream(StreamSystem.NoBuffer, BassFlags.Decode | BassFlags.Prescan, fileCallbacks.Callbacks, fileCallbacks.Handle);
|
||||
int decodeStream = Bass.CreateStream(StreamSystem.NoBuffer, BassFlags.Decode, fileCallbacks.Callbacks, fileCallbacks.Handle);
|
||||
|
||||
// If the format is not supported by BASS
|
||||
if (decodeStream == 0)
|
||||
@ -55,6 +55,8 @@ namespace osu.Game.Rulesets.Edit.Checks
|
||||
|
||||
if (!allowedFormats.Contains(audioInfo.ChannelType))
|
||||
yield return new IssueTemplateIncorrectFormat(this).Create(audioFile.Filename, audioInfo.ChannelType.ToString());
|
||||
|
||||
Bass.StreamFree(decodeStream);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user