Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring back sleeping code for periodic frame timing #120

Merged
merged 3 commits into from
Nov 22, 2024

Conversation

longnguyen2004
Copy link
Collaborator

Turns out relying on -re to provide periodic frame output is wrong, as I learned the hard way. This PR reintroduces the sleeping code for periodic frame output, which also involves getting backpressure to work so that memory leaks don't happen.

The mechanism for this is pretty simple. Frames are repeatedly extracted from the input stream until either the video or audio pipe reaches highWaterMark, after which we pause the input stream. When the pipe has been drained, we resume the input stream and continue extraction.

Unfortunately, this only partially fixes #115, something in the video file is causing consistent 5+ seconds pauses, that doesn't happen with other files that I've tested. Will continue to investigate. For now please give this a try.

@dank074 dank074 merged commit a2d016e into dank074:master Nov 22, 2024
@longnguyen2004 longnguyen2004 deleted the bring-back-sleeping branch November 23, 2024 05:52
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.

Latest update seems to break all of my media (playback very choppy)
2 participants