Skip to content

obs-outputs: Fix path normalization logic#13206

Open
grimfoss wants to merge 1 commit intoobsproject:masterfrom
grimfoss:fix-directory-format-normalization-logic-error
Open

obs-outputs: Fix path normalization logic#13206
grimfoss wants to merge 1 commit intoobsproject:masterfrom
grimfoss:fix-directory-format-normalization-logic-error

Conversation

@grimfoss
Copy link

@grimfoss grimfoss commented Mar 10, 2026

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:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

…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
@Warchamp7 Warchamp7 added the Bug Fix Non-breaking change which fixes an issue label Mar 10, 2026
@grimfoss
Copy link
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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Fix Non-breaking change which fixes an issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants