diff --git a/srt/stream_ids.go b/srt/stream_ids.go index 7f598e1..f8df568 100644 --- a/srt/stream_ids.go +++ b/srt/stream_ids.go @@ -25,7 +25,10 @@ func CleanFiles(stream_key string, delay time.Duration) { time.Sleep(delay * time.Second) base_dir, _ := os.UserHomeDir() stream_dir := base_dir + "/live/" + stream_key - fileinfo, _ := os.Stat(stream_dir + "/init.mp4") + fileinfo, file_ok := os.Stat(stream_dir + "/init.mp4") + if file_ok != nil { + return + } if time.Now().Sub(fileinfo.ModTime()) > delay * time.Second { leftover_files, _ := filepath.Glob(stream_dir + "/*") for _, file := range leftover_files {