diff --git a/Blish HUD/GameServices/GameIntegration/AudioIntegration.cs b/Blish HUD/GameServices/GameIntegration/AudioIntegration.cs index 580b2ef67..ed444c936 100644 --- a/Blish HUD/GameServices/GameIntegration/AudioIntegration.cs +++ b/Blish HUD/GameServices/GameIntegration/AudioIntegration.cs @@ -76,7 +76,14 @@ public override void Update(GameTime gameTime) { if (_timeSinceCheck > CHECK_INTERVAL) { _timeSinceCheck -= CHECK_INTERVAL; - _audioPeakBuffer.PushValue(_processMeterInformation.GetPeakValue()); + try { + _audioPeakBuffer.PushValue(_processMeterInformation.GetPeakValue()); + } catch (Exception e) { + // Punish audio clock for 10 seconds + _timeSinceCheck = -10000; + + Logger.Debug(e, "Getting meter volume failed."); + } _averageGameVolume = null; } diff --git a/Blish HUD/GameServices/Input/Mouse/MouseHandler.cs b/Blish HUD/GameServices/Input/Mouse/MouseHandler.cs index c166ee3d7..80fb7eb04 100644 --- a/Blish HUD/GameServices/Input/Mouse/MouseHandler.cs +++ b/Blish HUD/GameServices/Input/Mouse/MouseHandler.cs @@ -109,16 +109,14 @@ public void Update() { var rawMouseState = Mouse.GetState(); - this.State = new MouseState( - (int) (this.PositionRaw.X / GameService.Graphics.UIScaleMultiplier), - (int) (this.PositionRaw.Y / GameService.Graphics.UIScaleMultiplier), - _mouseEvent?.WheelDelta ?? 0, + this.State = new MouseState((int) (rawMouseState.X / GameService.Graphics.UIScaleMultiplier), + (int) (rawMouseState.Y / GameService.Graphics.UIScaleMultiplier), + _mouseEvent?.WheelDelta ?? 0, rawMouseState.LeftButton, rawMouseState.MiddleButton, rawMouseState.RightButton, rawMouseState.XButton1, - rawMouseState.XButton2 - ); + rawMouseState.XButton2); // Handle mouse moved if (prevMouseState.Position != this.State.Position) {