From f1a31bcac80081e9acd5a045abe6a8dc9fc6527d Mon Sep 17 00:00:00 2001 From: goyuken Date: Wed, 26 Sep 2012 14:22:57 +0000 Subject: [PATCH] kill sound during d3d "reacquire" loop --- BizHawk.MultiClient/RenderPanel.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BizHawk.MultiClient/RenderPanel.cs b/BizHawk.MultiClient/RenderPanel.cs index a9fd8107ed..093410f0e9 100644 --- a/BizHawk.MultiClient/RenderPanel.cs +++ b/BizHawk.MultiClient/RenderPanel.cs @@ -443,11 +443,14 @@ namespace BizHawk.MultiClient { // Wait until device is available or user gets annoyed and closes app Result r; + // it can take a while for the device to be ready again, so avoid sound looping during the wait + if (Global.Sound != null) Global.Sound.StopSound(); do { r = Device.TestCooperativeLevel(); Thread.Sleep(100); } while (r == ResultCode.DeviceLost); + if (Global.Sound != null) Global.Sound.StartSound(); // lets try recovery! DestroyDevice(); @@ -501,6 +504,7 @@ namespace BizHawk.MultiClient public void Present() { + // Present() is the most likely place to get DeviceLost, so we need to wrap it RenderWrapper(_Present); }