fix: ensure that video buffers are empty before closing channels

This commit is contained in:
Charles Hathaway
2024-01-19 00:43:16 -08:00
parent 84eb188ada
commit 1a3f01ae03
11 changed files with 13 additions and 65 deletions
+4
View File
@@ -36,6 +36,10 @@ func New(video *h264video.Video, cfg *config.Config) (*FileWrite, error) {
// Run launches the commands and begins creating data. It will block until Done is called.
func (v *FileWrite) Run() {
if v.cfg.LocalCopy == "" {
// Feature is disabled; close right away
return
}
// Confirm that the target directory is a directory
stat, err := os.Stat(v.cfg.LocalCopy)
log := log.With().Str("directory", v.cfg.LocalCopy).Logger()