diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index d7356cf100..d342e495e2 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -691,19 +691,19 @@ namespace osu.Game.Beatmaps protected override Storyboard GetStoryboard() { - if (BeatmapInfo?.Path == null && BeatmapSetInfo?.StoryboardFile == null) - return new Storyboard(); - try { - Decoder decoder; - using (var stream = new StreamReader(store.GetStream(getPathForFile(BeatmapInfo?.Path)))) - decoder = Decoder.GetDecoder(stream); - // try for .osb first and fall back to .osu - string storyboardFile = BeatmapSetInfo.StoryboardFile ?? BeatmapInfo.Path; - using (var stream = new StreamReader(store.GetStream(getPathForFile(storyboardFile)))) - return decoder.GetStoryboardDecoder().DecodeStoryboard(stream); + using (var beatmap = new StreamReader(store.GetStream(getPathForFile(BeatmapInfo.Path)))) + { + Decoder decoder = Decoder.GetDecoder(beatmap); + + if (BeatmapSetInfo?.StoryboardFile == null) + return decoder.GetStoryboardDecoder().DecodeStoryboard(beatmap); + + using (var storyboard = new StreamReader(store.GetStream(getPathForFile(BeatmapSetInfo.StoryboardFile)))) + return decoder.GetStoryboardDecoder().DecodeStoryboard(beatmap, storyboard); + } } catch { diff --git a/osu.Game/Beatmaps/Formats/Decoder.cs b/osu.Game/Beatmaps/Formats/Decoder.cs index 8eeada66e8..1aae52208a 100644 --- a/osu.Game/Beatmaps/Formats/Decoder.cs +++ b/osu.Game/Beatmaps/Formats/Decoder.cs @@ -70,10 +70,11 @@ namespace osu.Game.Beatmaps.Formats protected abstract void ParseBeatmap(StreamReader stream, Beatmap beatmap); - public virtual Storyboard DecodeStoryboard(StreamReader stream) + public virtual Storyboard DecodeStoryboard(params StreamReader[] streams) { var storyboard = new Storyboard(); - ParseStoryboard(stream, storyboard); + foreach (StreamReader stream in streams) + ParseStoryboard(stream, storyboard); return storyboard; }