Skip to content

Commit

Permalink
Merge pull request #26484 from bdach/only-validate-playback-rate-when…
Browse files Browse the repository at this point in the history
…-submitting

Only validate playback rate when in submission context
  • Loading branch information
peppy authored Jan 13, 2024
2 parents 02975b9 + 6572fa4 commit 98fe9f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Taiko;
using osu.Game.Scoring;
using osu.Game.Screens.Play;
using osu.Game.Screens.Ranking;
using osu.Game.Tests.Beatmaps;

Expand Down Expand Up @@ -360,11 +359,6 @@ public FakeImportingPlayer(bool allowPause = true, bool showResults = true, bool
AllowImportCompletion = new SemaphoreSlim(1);
}

protected override GameplayClockContainer CreateGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStart) => new MasterGameplayClockContainer(beatmap, gameplayStart)
{
ShouldValidatePlaybackRate = false,
};

protected override async Task ImportScore(Score score)
{
ScoreImportStarted = true;
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Screens/Play/MasterGameplayClockContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public partial class MasterGameplayClockContainer : GameplayClockContainer, IBea
/// Whether the audio playback rate should be validated.
/// Mostly disabled for tests.
/// </summary>
internal bool ShouldValidatePlaybackRate { get; init; } = true;
internal bool ShouldValidatePlaybackRate { get; init; }

/// <summary>
/// Whether the audio playback is within acceptable ranges.
Expand Down
5 changes: 5 additions & 0 deletions osu.Game/Screens/Play/SubmittingPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ private void load()
AddInternal(new PlayerTouchInputDetector());
}

protected override GameplayClockContainer CreateGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStart) => new MasterGameplayClockContainer(beatmap, gameplayStart)
{
ShouldValidatePlaybackRate = true,
};

protected override void LoadAsyncComplete()
{
base.LoadAsyncComplete();
Expand Down

0 comments on commit 98fe9f3

Please sign in to comment.