diff --git a/stream.go b/stream.go index 8ec92c7..eac96e4 100755 --- a/stream.go +++ b/stream.go @@ -10,7 +10,6 @@ import ( "net/http" "os" "path/filepath" - "sync" "time" "gocv.io/x/gocv" @@ -26,7 +25,6 @@ type Stream struct { WatchAreas []WatchArea `json:"watchAreas"` Timeouts float64 `json:"-"` MotionDetected bool `json:"-"` - FileLock sync.Mutex `json:"-"` } // NewStream creates a new Stream Object @@ -149,7 +147,6 @@ func (s *Stream) GetWatchAreaByName(name string) (*WatchArea, bool) { // SaveStreamInstant writes the img to the CurrentStreamInstantPath, moves existing instant to PreviousStreamInstantPath func (s *Stream) SaveStreamInstant(mat gocv.Mat) { - s.FileLock.Lock() streamStoreDir := s.GetStreamStoreDirPath() os.MkdirAll(streamStoreDir, os.ModePerm) @@ -165,7 +162,6 @@ func (s *Stream) SaveStreamInstant(mat gocv.Mat) { if swap { s.SwapInstants(s.GetPreviousInstantPath(), s.GetCurrentInstantPath(), s.GetNextInstantPath()) } - s.FileLock.Unlock() } // SwapInstants swaps the file location, first current -> previous and then next -> current