video_player: apply loudnorm audio filter on mpv init
Reads the _loudnorm flag (set by main_window from the DB setting) and applies af=loudnorm when mpv is first initialized.
This commit is contained in:
parent
73206994ec
commit
2e9b99e4b8
@ -337,6 +337,7 @@ class VideoPlayer(QWidget):
|
||||
self._stream_record_tmp: Path | None = None
|
||||
self._stream_record_target: Path | None = None
|
||||
self._seeked_during_record: bool = False
|
||||
self._loudnorm: bool = False
|
||||
|
||||
def _ensure_mpv(self) -> mpvlib.MPV:
|
||||
"""Set up mpv callbacks on first use. MPV instance is pre-created."""
|
||||
@ -364,6 +365,9 @@ class VideoPlayer(QWidget):
|
||||
# exists. The qproperty-letterboxColor setter is a no-op if mpv
|
||||
# hasn't been initialized yet, so we have to (re)apply on init.
|
||||
self._apply_letterbox_color()
|
||||
# Apply audio normalization if enabled in settings.
|
||||
if self._loudnorm:
|
||||
self._mpv.af = "loudnorm"
|
||||
return self._mpv
|
||||
|
||||
# -- Public API (used by app.py for state sync) --
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user