mirror of
https://github.com/ppy/osu.git
synced 2026-05-28 02:25:29 +08:00
Remove BassFlags.Prescan and free the decodeStream
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user