From a4ded5337dec14b65a3cb9ed915a94b3bedbbb5c Mon Sep 17 00:00:00 2001 From: saxon Date: Sun, 25 Nov 2018 17:24:52 +1030 Subject: [PATCH] revid: changed close operation on destination to close operpation on slice ofoperations in reset() --- revid/revid.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/revid/revid.go b/revid/revid.go index fde3efb7..f555e655 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -118,7 +118,7 @@ type Revid struct { // to the target destination. buffer *ring.Buffer // destination is the target endpoint. - destination loadSender + destination []loadSender // bitrate hold the last send bitrate calculation result. bitrate int @@ -200,12 +200,15 @@ func (r *Revid) reset(config Config) error { } r.config = config - if r.destination != nil { - err = r.destination.close() - if err != nil { - r.config.Logger.Log(smartlogger.Error, pkg+"could not close destination", "error", err.Error()) + for i, destination := range r.destination { + if destination != nil { + err = destination.close() + if err != nil { + return err + } } } + switch r.config.Output { case File: s, err := newFileSender(config.OutputFileName)