Skip to content

fix: toggle_auto_change_frame divides by zero with default fps - #15

Open
andrewwhitecdw wants to merge 1 commit into
NVIDIA:masterfrom
andrewwhitecdw:bugfix/nvdu-viz-window-862f8501
Open

andrewwhitecdw wants to merge 1 commit into
NVIDIA:masterfrom
andrewwhitecdw:bugfix/nvdu-viz-window-862f8501

Conversation

@andrewwhitecdw

@andrewwhitecdw andrewwhitecdw commented Jul 27, 2026 •

Copy link
Copy Markdown

Problem

fix: toggle_auto_change_frame divides by zero with default fps

Fix

Replace:

    def set_auto_change_frame(self, new_bool):
        if (self.auto_change_frame == new_bool):
            return

        self.auto_change_frame = new_bool
        if (self.auto_change_frame):
            print("Start auto changing frame ...")
            wait_duration = 1.0 / self.auto_fps
            pyglet.clock.schedule_interval(self.visualize_next_frame, wait_duration)

with:

    def set_auto_change_frame(self, new_bool):
        if (self.auto_change_frame == new_bool):
            return

        if (new_bool and self.auto_fps <= 0):
            print("auto_fps is not set, cannot start auto changing frame")
            return

        self.auto_change_frame = new_bool
        if (self.auto_change_frame):
            print("Start auto changing frame ...")
            wait_duration = 1.0 / self.auto_fps
            pyglet.clock.schedule_interval(self.visualize_next_frame, wait_duration)

Files changed

  • nvdu/viz/nvdu_viz_window.py

@andrewwhitecdw
andrewwhitecdw marked this pull request as ready for review July 27, 2026 21:21
@andrewwhitecdw

Copy link
Copy Markdown
Author

Closing this sweep-generated PR: sole commit is missing a valid Signed-off-by trailer. It does not meet the sweep requirements (single signed-off commit).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant