obs-outputs: Fix path normalization logic#13206
Open
grimfoss wants to merge 1 commit intoobsproject:masterfrom
Open
obs-outputs: Fix path normalization logic#13206grimfoss wants to merge 1 commit intoobsproject:masterfrom
grimfoss wants to merge 1 commit intoobsproject:masterfrom
Conversation
…ws-style directory in filename format input field, causing encoding to fail or OBS to crash outright when the directory would change during a file split in both mp4-output.c and obs-ffmpeg-mux.c
Author
|
Background if there are issues: I'm a CS student who's only taken some intro classes so far, I ran into this issue and tracked down the cause pretty quickly and wanted to try my hand at fixing it. I'm not incredibly familiar with git but I believe I followed everything to a tee. Never contributed to anything before so any feedback on any part of this would be greatly appreciated! |
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
Changed order of operations in generate_filename() in both mp4-output.c and obs-ffmpeg-mux.c so that the full file path gets normalized to use forward slashes, instead of just the directory.
Motivation and Context
In the event that the user provides a formatting string with windows-style directories (%MM\%DD\%hh-%mm-%ss), encoding would either fail to open a new file or crash entirely if the file would be split after the date changes, due to the logic for making a new directory during file splitting only looking for the last forward slash.
How Has This Been Tested?
To test, I set automatic file splitting to 1 minute, and made the formatting string "%ss\%mm" so every split was guaranteed to make a new directory. Running a recording for one minute in each format no longer resulted in a crash or failure at the split, and a new directory being created was successfully observed in each test.
Testing environment:
Windows 11 Home 10.0.26200
AMD Ryzen 9 7900x Processor
Nvidia RTX 5070 Gpu
32GB GDDR5 Memory
Testing was done manually, and I do not expect these changes to affect any other areas.
Types of changes
Bug fix (non-breaking change which fixes an issue)
Tweak (non-breaking change to improve existing functionality)
Checklist: