Skip to content

linux-v4l2: Continue virtual camera frames after short writes (Refs #1464) - #1558

Merged
zackees merged 2 commits into
masterfrom
fix/v4l2-vcam-short-write
Oct 20, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/v4l2-vcam-short-write

Conversation

@zackees

@zackees zackees commented Oct 20, 2026

Copy link
Copy Markdown
Member

Refs #1464 (split from it: one small PR per fix)

What and why

virtual_video() resent the frame from its first byte with the full length after a short write, so the v4l2loopback device got the start of the frame where the rest belonged (and the remaining count could run past zero). It now advances the pointer and length, retries EINTR, and stops on other errors or a zero-byte write.

RED → GREEN

  • RED commit: a0d799786 adds test/cmocka/test_v4l2_vcam_write.c: the real v4l2-output.c with write() wrapped to take at most 300 bytes per call (or fail once with EINTR). On master short_writes_continue_the_frame (device got the frame's first bytes again) and interrupted_write_is_retried fail; whole_frame_in_one_write passes (guard).
  • GREEN: the fix cherry-picked unchanged from fix: 20 bug fixes in libobs callbacks, muxer, audio and build #1464; the new test passes. Checked locally by compiling the new test against the plugin source at both commits (obs-rust-linux-validate image, minimal libobs stand-in); PR CI (Tier 2) is the gate.
  • Real app: not run (no UI or log change beyond the fix itself).

Checklist

@zackees
zackees enabled auto-merge October 20, 2026 20:22
@zackees
zackees added this pull request to the merge queue Oct 20, 2026
Merged via the queue into master with commit c0d4f59 Oct 20, 2026
23 checks passed
@zackees
zackees deleted the fix/v4l2-vcam-short-write branch October 26, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant