Skip to content

Commit feb6f17

Browse files
summeroffclaude
andcommitted
fix: keep a running output's claim when start() is called again
The previous commit stopped the failure path from releasing a claim while the muxer was still writing, but the resolve path could still move it. A duplicate start() runs the whole Start() handler first: the timestamp has advanced, so FindBestFilename resolves a different name and reassigned claimedFilePath to it. obs_output_start() then refuses because the output is active, leaving the muxer on its original file with nothing claiming it -- and an output with overwrite set skips the on-disk check that would otherwise have covered it. Only take the claim when the output is not already active. obs_output_active() is null-safe, so an output that has not been created yet claims normally. Rejecting the duplicate start outright would be the more thorough fix, but that changes what the Start IPC call returns for a case Desktop can reach through validateOrCreateOutputInstance, so it wants deciding on its own terms. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent fb8cf45 commit feb6f17

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

obs-studio-server/source/osn-file-output.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ void osn::IFileOutput::FindBestFilename(std::string &strPath, bool noSpace, File
107107

108108
strPath = candidate;
109109

110-
if (owner)
110+
// Never move the claim of an output that is already running. A duplicate start() resolves a
111+
// fresh name -- the timestamp has moved on -- but obs_output_start() then refuses and the muxer
112+
// stays on its original file. Reassigning here would unclaim the file actually being written.
113+
if (owner && !obs_output_active(owner->GetOutput()))
111114
owner->claimedFilePath = strPath;
112115
}
113116

0 commit comments

Comments
 (0)