Skip to content

Commit

Permalink
MP1-5199: Core: VolumeHandler: Restore Windows Volume OSD on dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
epbk committed Feb 23, 2024
1 parent 3739754 commit 37b6913
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions mediaportal/Core/Player/VolumeHandler.cs
Expand Up @@ -109,7 +109,9 @@ public VolumeHandler(int[] volumeTable)

_showVolumeOSD = true;

VolumeOSD = new HideVolumeOSD.HideVolumeOSDLib(IsMuted);
if (VolumeOSD == null)
VolumeOSD = new HideVolumeOSD.HideVolumeOSDLib(IsMuted);

VolumeOSD.HideOSD();

_showVolumeOSD = tempShowVolumeOSD;
Expand Down Expand Up @@ -174,7 +176,9 @@ public VolumeHandler(int[] volumeTable)

_showVolumeOSD = true;

VolumeOSD = new HideVolumeOSD.HideVolumeOSDLib(IsMuted);
if (VolumeOSD == null)
VolumeOSD = new HideVolumeOSD.HideVolumeOSDLib(IsMuted);

VolumeOSD.HideOSD();

_showVolumeOSD = tempShowVolumeOSD;
Expand Down Expand Up @@ -368,6 +372,11 @@ public static void Dispose()
_instance._mixer.SafeDispose();
_instance._mixer = null;
}

//Restore native Windows Volume OSD
if (VolumeOSD != null)
VolumeOSD.ShowOSD();

_instance = null;
GUIGraphicsContext.VolumeHandler = null;
}
Expand Down

0 comments on commit 37b6913

Please sign in to comment.