mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 04:04:21 -04:00
Fix out of range segment for last segment
This commit is contained in:
parent
995f50cc21
commit
6c9a0ea576
@ -224,7 +224,7 @@ func (ts *Stream) GetSegment(segment int32) (string, error) {
|
|||||||
distance = ts.getMinEncoderDistance(segment)
|
distance = ts.getMinEncoderDistance(segment)
|
||||||
} else {
|
} else {
|
||||||
// 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))); 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) {
|
||||||
// no need to create a new transcoder if there is already one running for this segment
|
// no need to create a new transcoder if there is already one running for this segment
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user