Repository navigation
Start recording once the source has video - #198
Open
samaistudio wants to merge 1 commit into
Open
samaistudio wants to merge 1 commit into
samaistudio wants to merge 1 commit into
Conversation
When the record (or record-when-streaming) mode kicks in while the parent source has no size yet, there is no video output, so start_file_output is skipped. filter->record is still set to true, so later updates see no change and the file output is never created. Nothing is recorded for the whole session. This happens easily on macOS: a Continuity Camera that connects after OBS starts, a capture card that is still waking up, or a window capture whose window was closed and reopened. In the tick, once the video output exists and recording is wanted but no file output was created, reset the flag and queue the normal update, so the recording starts through the usual path (encoders included).
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.
Problem
If recording starts (record mode "Recording", "Streaming", etc.) while the parent source has no size yet, no file is ever written for that session.
In
source_record_filter_update,start_file_outputis only called whenfilter->video_outputalready exists. That only happens once the tick has seen a non-zero source size.filter->recordis set totrueanyway, so when the source gets video a moment later, every later update seesrecord == filter->recordand never starts the output.Easy ways to hit it on macOS:
Fix
In the tick, if recording is wanted, the video output now exists and no file output was created, reset
filter->recordand queue the normal update, so the recording starts through the usual path (encoders included). A flag keeps it from being queued more than once.Testing
macOS (Apple Silicon), OBS 33.0.1, built against the 33.0.1 headers: