From 6806d1f242fa6bc205cdb1f0d29b5ea291d54e31 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 12 Feb 2024 17:39:00 +0100 Subject: [PATCH] Disable audio future heads preparation --- transcoder/src/stream.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/transcoder/src/stream.go b/transcoder/src/stream.go index a8a28b67..ae116b90 100644 --- a/transcoder/src/stream.go +++ b/transcoder/src/stream.go @@ -358,6 +358,12 @@ func (ts *Stream) GetSegment(segment int32) (string, error) { } func (ts *Stream) prerareNextSegements(segment int32) { + // Audio is way cheaper to create than video so we don't need to run them in advance + // Running it in advance might actually slow down the video encode since less compute + // power can be used so we simply disable that. + if ts.handle.getFlags()&VideoF == 0 { + return + } ts.lock.RLock() defer ts.lock.RUnlock() for i := segment + 1; i <= min(segment+10, int32(len(ts.segments)-1)); i++ {