mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 09:27:18 +09:00
Merge pull request #1484 from peppy/fix-player-audio-loading
Ensure we wait for audio track reset before proceeding with player execution
This commit is contained in:
commit
ae0e3a01b8
@ -1 +1 @@
|
|||||||
Subproject commit db625dc65fb7ae9be154b03a0968b2f8cedb036d
|
Subproject commit 5e26808ec77a8fd600cb1cdca3a4b2f62fd0c653
|
@ -17,6 +17,8 @@ using osu.Game.Rulesets.UI;
|
|||||||
using osu.Game.Screens.Backgrounds;
|
using osu.Game.Screens.Backgrounds;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
@ -142,14 +144,21 @@ namespace osu.Game.Screens.Play
|
|||||||
userAudioOffset.ValueChanged += v => offsetClock.Offset = v;
|
userAudioOffset.ValueChanged += v => offsetClock.Offset = v;
|
||||||
userAudioOffset.TriggerChange();
|
userAudioOffset.TriggerChange();
|
||||||
|
|
||||||
Schedule(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
adjustableSourceClock.Reset();
|
adjustableSourceClock.Reset();
|
||||||
|
|
||||||
foreach (var mod in working.Mods.Value.OfType<IApplicableToClock>())
|
// this is temporary until we have blocking (async.Wait()) audio component methods.
|
||||||
mod.ApplyToClock(adjustableSourceClock);
|
// then we can call ResetAsync().Wait() or the blocking version above.
|
||||||
|
while (adjustableSourceClock.IsRunning)
|
||||||
|
Thread.Sleep(1);
|
||||||
|
|
||||||
decoupledClock.ChangeSource(adjustableSourceClock);
|
Schedule(() =>
|
||||||
|
{
|
||||||
|
decoupledClock.ChangeSource(adjustableSourceClock);
|
||||||
|
foreach (var mod in working.Mods.Value.OfType<IApplicableToClock>())
|
||||||
|
mod.ApplyToClock(adjustableSourceClock);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user