Repository navigation
obs-ffmpeg-mux: seek contract, failed-open cleanup, exit status, split argv (split from #1464) - #1553
Merged
Merged
Conversation
zackees
enabled auto-merge
October 20, 2026 20:14
… argv (RED) Split from #1464. Fails on master: the seek callback returns 0, free_avformat dereferences a NULL pb after a failed open, main returns 0 after a packet error, and read_change_file leaves argv[1] on its own buffer on failure.
…nd split argv (GREEN) Split from #1464 (commits ab56688, cd07703, eadd067, ce1d1ff): - the AVIO seek callback returns the new position and fails unsupported whence values (AVSEEK_SIZE, SEEK_END) and out-of-range offsets; - free_avformat() skips the IO context when it was never allocated; - main() returns FFM_ERROR after a packet read/write failure; - read_change_file() restores argv[1] before reporting a failed init.
zackees
force-pushed
the
fix/ffmpeg-mux-split
branch
from
October 20, 2026 21:11
0fbbf50 to
84e5042
Compare
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.
Split from #1464 (the obs-ffmpeg-mux part).
Fixes in
plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c.h:ffmpeg_mux_seek_av_bufferreturned 0 for every seek. Per the AVIO contract it now returns the new position, stripsAVSEEK_FORCE, and returns -1 forAVSEEK_SIZE/SEEK_ENDand for offsets before 0 or past INT64_MAX.free_avformatdereferenced the NULLoutput->pb. It now skips the IO context when it was never allocated.mainreturned 0 even after a packet read/write error; it now returnsFFM_ERROR.read_change_fileleftargv[1]pointing at its own filename buffer; main then freed it (and on Windows freedargv[1]again).argv[1]is restored before the result is checked.Evidence: new cmocka test
test/cmocka/test_ffmpeg_mux_helper.c(registered intests.d/test_ffmpeg_mux_helper.cmake, Linux) includes ffmpeg-mux.c.h withmainrenamed and calls the static functions directly: seek positions/rejections,ffmpeg_mux_init_contexton an uncreatable path (crashes on master),mainfed a truncated packet via stdin (returns 0 on master), andread_change_filefailure (argv[1] not restored on master). Commit 1 is RED, commit 2 GREEN. Not built locally (no FFmpeg/cmocka on the shared host);./lintpasses; PR CI Tier 2 is the gate.Ledger line added to docs/features.md.