From 925d71dbba0562b1a5586b9d0f66cc54cc7636ef Mon Sep 17 00:00:00 2001 From: David Colburn Date: Tue, 19 Sep 2023 17:44:32 -0700 Subject: [PATCH] fix duration --- pkg/pipeline/sink/segments.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/pipeline/sink/segments.go b/pkg/pipeline/sink/segments.go index e7176b1e..3c1964aa 100644 --- a/pkg/pipeline/sink/segments.go +++ b/pkg/pipeline/sink/segments.go @@ -187,8 +187,9 @@ func (s *SegmentSink) endSegment(filename string, endTime uint64) error { } delete(s.openSegmentsStartTime, filename) + duration := float64(time.Duration(endTime-t) / time.Second) segmentStartTime := s.startTime.Add(time.Duration(t - s.startRunningTime)) - if err := s.playlist.Append(segmentStartTime, float64(endTime-t), filename); err != nil { + if err := s.playlist.Append(segmentStartTime, duration, filename); err != nil { return err }