Repository: ManimCommunity/manim
File: manim/scene/scene.py (Python)

Code before:
                return None
        else:
            # Paint all non-moving objects onto the screen, so they don't
            # have to be rendered every frame
            (
                self.moving_mobjects,
                self.static_mobjects,
            ) = self.get_moving_and_static_mobjects(self.animations)
        return self

    def begin_animations(self) -> None:
        """Start the animations of the scene."""
        for animation in self.animations:
            animation.begin()

    def is_current_animation_frozen_frame(self) -> bool:
        """Returns wether the current animation produces a static frame (generally a Wait)."""
        return (
            isinstance(self.animations[0], Wait)
            and len(self.animations) == 1
            and self.animations[0].is_static_wait
        )

    def play_internal(self, skip_rendering=False):
        """
        This method is used to prep the animations for rendering,
        apply the arguments and parameters required to them,
        render them, and write them to the video file.

        Parameters
        ----------
        args
            Animation or mobject with mobject method and params
        kwargs
            named parameters affecting what was passed in ``args``,
            e.g. ``run_time``, ``lag_ratio`` and so on.
        """
        self.duration = self.get_run_time(self.animations)
        self.time_progression = self._get_animation_time_progression(
            self.animations, self.duration
        )
        for t in self.time_progression:
            self.update_to_time(t)
            if not skip_rendering:
                self.renderer.render(self, self.moving_mobjects)
            if self.stop_condition is not None and self.stop_condition():
                self.time_progression.close()
                break

        for animation in self.animations:
            animation.finish()

Review comment (suggestion):
This seems to be the culprit
```suggestion
        self.duration = self.get_run_time(self.animations)
```

Code after:

        Returns
        -------
        self, None
            None if there is nothing to play, or self otherwise.
        """
        # NOTE TODO : returns statement of this method are wrong. It should return nothing, as it makes a little sense to get any information from this method.
        # The return are kept to keep webgl renderer from breaking.
        if len(animations) == 0:
            raise ValueError("Called Scene.play with no animations")

        self.animations = self.compile_animations(*animations, **play_kwargs)
        self.add_mobjects_from_animations(self.animations)

        self.last_t = 0
        self.stop_condition = None
        self.moving_mobjects = None
        self.static_mobjects = None

        if not config["use_opengl_renderer"]:
            if len(self.animations) == 1 and isinstance(self.animations[0], Wait):
                self.update_mobjects(dt=0)  # Any problems with this?
                if self.should_update_mobjects():
                    self.stop_condition = self.animations[0].stop_condition
                else:
                    self.duration = self.animations[0].duration
                    # Static image logic when the wait is static is done by the renderer, not here.
                    self.animations[0].is_static_wait = True
                    return None
            else:
                # Paint all non-moving objects onto the screen, so they don't
                # have to be rendered every frame
                (
                    self.moving_mobjects,
                    self.static_mobjects,
                ) = self.get_moving_and_static_mobjects(self.animations)
        self.duration = self.get_run_time(self.animations)
        return self

    def begin_animations(self) -> None:
        """Start the animations of the scene."""
        for animation in self.animations:
            animation.begin()

    def is_current_animation_frozen_frame(self) -> bool:
        """Returns wether the current animation produces a static frame (generally a Wait)."""
        return (
            isinstance(self.animations[0], Wait)
            and len(self.animations) == 1
            and self.animations[0].is_static_wait
        )