From dd9e0b4fc7b6af31cda904e66229c0af96f2b105 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Fri, 19 Jan 2024 23:49:10 +0100 Subject: [PATCH] Prevent unnecesarry future head creation --- transcoder/src/stream.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transcoder/src/stream.go b/transcoder/src/stream.go index e3c693b0..8dfcff07 100644 --- a/transcoder/src/stream.go +++ b/transcoder/src/stream.go @@ -222,7 +222,7 @@ func (ts *Stream) GetSegment(segment int32) (string, error) { distance := 0. if !ready { distance = ts.getMinEncoderDistance(segment) - } else { + } else if !slices.Contains(ts.heads, segment) { // if the current segment is ready, check next segments are ready and if not start a transcode for them for i := segment + 1; i <= min(segment+10, int32(len(ts.segments)-1)); i++ { if slices.Contains(ts.heads, i) {