Honour timeout when muxing and closing an output container - #1
Closed
adrianrfreedman wants to merge 3 commits into
Closed
adrianrfreedman wants to merge 3 commits into
adrianrfreedman wants to merge 3 commits into
Conversation
av_hwframe_transfer_data() is a full GPU<->host frame copy that ran on every hwaccel decoded/encoded frame while holding the GIL. Wrap call sites, folding av_hwframe_get_buffer() into the upload's region since it blocks when the surface pool is exhausted.
adrianrfreedman
force-pushed
the
fix/output-timeout-mux-close
branch
from
September 23, 2026 14:38
32f1296 to
e509ffd
Compare
Only opening armed the interrupt callback, so a peer that accepted the connection and then stopped reading left av_interleaved_write_frame() and av_write_trailer() blocked forever. Arm the read timeout around both. Each mux gets the full timeout, as each demux already does. A close shares one deadline across writing the trailer and flushing, so it cannot outlast the timeout it was given. The close side has no test of its own. A timed-out write leaves its error on the AVIO context, so the trailer then fails at once rather than blocking, and I could not get a peer to stall only between the last mux and the close: loopback buffers are far larger than the 32KB AVIO buffer, and AF_UNIX ones are small enough that the header blocks first.
adrianrfreedman
force-pushed
the
fix/output-timeout-mux-close
branch
from
September 23, 2026 14:58
e509ffd to
7a7d4a9
Compare
Owner
Author
|
PyAV-Org#2412 has merged, so 2414 is a single commit against main now. This view is no longer needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked view of PyAV-Org#2414, scoped to just the new commits. The upstream PR is PyAV-Org#2414; this one exists only so the diff excludes PyAV-Org#2412.