Skip to content

Commit 60c4401

Browse files
author
tom
committed
fix: windows BlackBoxOverlay freezing due to zoomed state, and VLC failing to load with gain parameter
1 parent 3982836 commit 60c4401

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/logic/media_utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,12 @@ def play_video_vlc(file_path, config=None):
174174

175175
# Audio gain
176176
if gain is not None and gain != 0:
177-
# simple linear volume adjustment roughly for VLC
178-
cmd.append(f"--mmdevice-volume={min(1.0, max(0.0, 1.0 + (float(gain) / 40.0)))}")
179-
177+
try:
178+
# Convert dB gain to linear multiplier, VLC 256 is 100%
179+
linear_gain = 10 ** (float(gain) / 20.0)
180+
cmd.append(f"--volume={int(256 * linear_gain)}")
181+
except Exception:
182+
pass
180183
logging.info(f"Launching VLC: {cmd}")
181184
result = subprocess.run(cmd, capture_output=True, text=True, env=get_clean_env())
182185

src/ui/overlay.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ def __init__(self, master, on_close=None, opacity=1.0):
1414

1515
# Windows specific fix for fullscreen coverage
1616
if hasattr(sys, 'platform') and sys.platform == 'win32':
17-
self.state('zoomed')
18-
self.geometry(f"{self.winfo_screenwidth()}x{self.winfo_screenheight()}+0+0")
1917
self.overrideredirect(True)
18+
self.geometry(f"{self.winfo_screenwidth()}x{self.winfo_screenheight()}+0+0")
2019

2120
# Opacity handling (Windows/Linux support varies)
2221
try:
@@ -57,7 +56,6 @@ def show(self):
5756

5857
# Windows specific re-application
5958
if hasattr(sys, 'platform') and sys.platform == 'win32':
60-
self.state('zoomed')
6159
self.overrideredirect(True)
6260

6361
except Exception as e:

0 commit comments

Comments
 (0)