obs-studio
obs-studio copied to clipboard
obs-ffmpeg: Refactor muxer file path code
Description
Refactors parts of the mux outputs which deal with file paths.
General idea:
- Allows the
pathsettings field to be unset, provided the appropriatedirectory,format, andextensionfields have been set- If
pathis not set, it will generate its own initial file name
- If
- Moves general path storage to
stream->path - Gets rid of a lot of unnecessary passing around of path strings between functions
- Adds a
last_filefield to thefile_changedoutput signal for future usage by the UI for auto-remux and other features when file splitting is enabled
Motivation and Context
This allows us to optionally move path generation to the output, away from the UI. This has benefits, notable for code deduplication and also for synchronizing behavior. It is also required for other features like inserting the part number into a file name for file splitting.
How Has This Been Tested?
Unfortunately, this does touch a lot of code paths with little immediate user-facing benefits. I've done the best I can do testing this and I am not seeing any changed behavior, crashes, or memory leaks- so that's good I guess.
- Tested normal recording
- Split file recording
- HLS streaming
- Replay buffer start/stop/save
- Other things like closing OBS while recording is running
Types of changes
- Tweak (non-breaking change to improve existing functionality)
- Code cleanup (non-breaking change which makes code smaller or more readable)
Checklist:
- [x] My code has been run through clang-format.
- [x] I have read the contributing document.
- [x] My code is not on the master branch.
- [x] The code has been tested.
- [x] All commit messages are properly formatted and commits squashed where appropriate.
- [x] I have included updates to all appropriate documentation.