obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

obs-ffmpeg: Refactor muxer file path code

Open tt2468 opened this issue 2 years ago • 0 comments

Description

Refactors parts of the mux outputs which deal with file paths.

General idea:

  • Allows the path settings field to be unset, provided the appropriate directory, format, and extension fields have been set
    • If path is not set, it will generate its own initial file name
  • Moves general path storage to stream->path
  • Gets rid of a lot of unnecessary passing around of path strings between functions
  • Adds a last_file field to the file_changed output 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.

tt2468 avatar Apr 23 '23 09:04 tt2468