mirror of https://bitbucket.org/ausocean/av.git
filter/mog.go: Write returns 0 instead of -1
This commit is contained in:
parent
29443bd61f
commit
3e19fb7cd6
|
@ -77,7 +77,7 @@ func (m *MOGFilter) Close() error {
|
|||
func (m *MOGFilter) Write(f []byte) (int, error) {
|
||||
img, err := gocv.IMDecode(f, gocv.IMReadColor)
|
||||
if err != nil {
|
||||
return -1, fmt.Errorf("image can't be decoded: %w", err)
|
||||
return 0, fmt.Errorf("image can't be decoded: %w", err)
|
||||
}
|
||||
defer img.Close()
|
||||
|
||||
|
@ -125,7 +125,7 @@ func (m *MOGFilter) Write(f []byte) (int, error) {
|
|||
|
||||
// Don't write to destination if there is no motion.
|
||||
if len(contours) == 0 {
|
||||
return -1, nil
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
// Write to destination.
|
||||
|
|
Loading…
Reference in New Issue