Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

Commit

Permalink
Trying to make it more precise
Browse files Browse the repository at this point in the history
  • Loading branch information
marioortizmanero committed Jan 3, 2020
1 parent e492eee commit c5c8610
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
15 changes: 14 additions & 1 deletion vidify/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,26 @@ def __new__(cls, description: str, args: Optional[Tuple[str]],
audiosync = (
"enable automatic audio synchronization. You may need to install"
" additional dependencies. Read the installation guide for more"
" information.",
" information. Note: this feature is still in the alpha stage.",
('--audiosync',),
'store_true',
'Defaults',
bool,
False)

# Option to tweak the audio synchronization extension. The default value
# is for a more or less decent computer.
audiosync_calibration = (
"the audio synchronization's precision may depend on your hardware."
" You can calibrate the delay it has in milliseconds with this. The"
" value for this feature will be added to what audiosync returns,"
" so it can be positive or negative."
('--audiosync-calibration',),
'store',
'Defaults',
int,
3400)

# Arguments and options provided for the players.
vlc_args = (
"custom arguments used when opening VLC.",
Expand Down
3 changes: 3 additions & 0 deletions vidify/gui/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ def on_audiosync_done(self, lag: int) -> None:
# they are perfectly synchronized
return

# Adding the user's custom audiosync delay
lag += self.config.audiosync_calibration

# TODO: What to do when the audiosync finishes before the video
# starts playing?
if self.player_delay is not None:
Expand Down

0 comments on commit c5c8610

Please sign in to comment.