Repository navigation
frontend: Sanitize filenames in Advanced mode - #14046
Open
Johnsoac671 wants to merge 1 commit into
Open
Johnsoac671 wants to merge 1 commit into
Johnsoac671 wants to merge 1 commit into
Conversation
Simple output mode replaces characters in filename formats not supported in Windows filenames with underscores, but Advanced output mode recordings leave them as is, causing them to fail to start on Windows. Apply the same sanitization on filename formats in Advanced output mode so both modes handle characters consistently.
This branch has not been deployed
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.
Description
Modified
AdvancedOutput::StartRecording()to sanitize filename formatting to match howSimpleOutput::ConfigureRecording()handles filenames.Motivation and Context
Fixes #13786
If a filename format was set with characters not allowed in Windows filenames while running OBS on Windows, any recording with Advanced output mode enabled would fail to start, due to a failure to create the associated video file.
Simple output mode avoided this failure by sanitizing filename formats to replace disallowed characters with underscores, however this was not performed during Advanced output mode.
How Has This Been Tested?
Testing Environment: AMD Ryzen 5 9600X, AMD Radeon RX 9070 XT, Windows 11, build from
masteroff commitf1c0a11with this change applied.I tested the change by starting and ending a recording, and confirming whether a video was properly output to the intended file destination under these circumstances:
%CCYY-%MM-%DD %hh_%mm_%ss)%CCYY-%MM-%DD %hh:%mm:%ss)%CCYY-%MM-%DD %hh_%mm_%ss)%CCYY-%MM-%DD %hh:%mm:%ss)%CCYY/%MM-%DD %hh_%mm_%ss)%CCYY/%MM-%DD %hh:%mm:%ss)All functioned as expected (video recorded and saved), with disallowed characters replaced with underscores
Types of changes
Checklist: