mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Prevent unnecesarry future head creation
This commit is contained in:
parent
6c9a0ea576
commit
dd9e0b4fc7
@ -222,7 +222,7 @@ func (ts *Stream) GetSegment(segment int32) (string, error) {
|
|||||||
distance := 0.
|
distance := 0.
|
||||||
if !ready {
|
if !ready {
|
||||||
distance = ts.getMinEncoderDistance(segment)
|
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
|
// 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++ {
|
for i := segment + 1; i <= min(segment+10, int32(len(ts.segments)-1)); i++ {
|
||||||
if slices.Contains(ts.heads, i) {
|
if slices.Contains(ts.heads, i) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user