diff --git a/osu.Framework.Tests/Visual/Sprites/TestVideo.cs b/osu.Framework.Tests/Visual/Sprites/TestVideo.cs index 070731cb5f..0724fb59c4 100644 --- a/osu.Framework.Tests/Visual/Sprites/TestVideo.cs +++ b/osu.Framework.Tests/Visual/Sprites/TestVideo.cs @@ -3,6 +3,7 @@ using System.IO; using System.Threading; +using System.Threading.Tasks; using osu.Framework.Graphics; using osu.Framework.Graphics.Video; using osu.Framework.IO.Network; @@ -14,7 +15,7 @@ internal class TestVideo : Video private static MemoryStream consumeVideoStream() { var wr = new WebRequest("https://assets.ppy.sh/media/landing.mp4"); - wr.PerformAsync(); + Task.Run(() => wr.PerformAsync()); while (!wr.Completed) Thread.Sleep(100); diff --git a/osu.Framework/IO/Network/WebRequest.cs b/osu.Framework/IO/Network/WebRequest.cs index abc4d7a9f3..55d92c4932 100644 --- a/osu.Framework/IO/Network/WebRequest.cs +++ b/osu.Framework/IO/Network/WebRequest.cs @@ -223,7 +223,7 @@ public byte[] GetResponseData() /// /// Performs the request asynchronously. /// - public async Task PerformAsync() => await PerformAsync(default); + public Task PerformAsync() => PerformAsync(default); /// /// Performs the request asynchronously.