mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 12:35:34 +08:00
Avoid setting the source clock until gameplay is ready to start
Without this change, the audio track may audibly seek during load proceedings.
This commit is contained in:
parent
ec61a94dc9
commit
29fed0c4a3
@ -70,14 +70,13 @@ namespace osu.Game.Beatmaps
|
||||
set => decoupledClock.IsCoupled = value;
|
||||
}
|
||||
|
||||
public FramedBeatmapClock(IClock? sourceClock = null, bool applyOffsets = false)
|
||||
public FramedBeatmapClock(bool applyOffsets = false)
|
||||
{
|
||||
this.applyOffsets = applyOffsets;
|
||||
|
||||
// A decoupled clock is used to ensure precise time values even when the host audio subsystem is not reporting
|
||||
// high precision times (on windows there's generally only 5-10ms reporting intervals, as an example).
|
||||
decoupledClock = new DecoupleableInterpolatingFramedClock { IsCoupled = true };
|
||||
decoupledClock.ChangeSource(sourceClock);
|
||||
|
||||
if (applyOffsets)
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ namespace osu.Game.Screens.Play
|
||||
/// By default, a value of zero will be used.
|
||||
/// Importantly, the value will be inferred from the current beatmap in <see cref="MasterGameplayClockContainer"/> by default.
|
||||
/// </remarks>
|
||||
public double StartTime { get; private set; }
|
||||
public double StartTime { get; protected set; }
|
||||
|
||||
public virtual IEnumerable<double> NonGameplayAdjustments => Enumerable.Empty<double>();
|
||||
|
||||
@ -71,7 +71,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
GameplayClock = new FramedBeatmapClock(sourceClock, applyOffsets) { IsCoupled = false },
|
||||
GameplayClock = new FramedBeatmapClock(applyOffsets) { IsCoupled = false },
|
||||
Content
|
||||
};
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ namespace osu.Game.Screens.Play
|
||||
this.beatmap = beatmap;
|
||||
this.skipTargetTime = skipTargetTime;
|
||||
|
||||
Reset(findEarliestStartTime());
|
||||
StartTime = findEarliestStartTime();
|
||||
}
|
||||
|
||||
private double findEarliestStartTime()
|
||||
|
Loading…
Reference in New Issue
Block a user