mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Make a happy path for keyframes.Slices
This commit is contained in:
parent
4fd25ce5ac
commit
0579afe02b
@ -35,7 +35,12 @@ func (kf *Keyframe) Slice(start int32, end int32) []float64 {
|
|||||||
}
|
}
|
||||||
kf.info.mutex.RLock()
|
kf.info.mutex.RLock()
|
||||||
defer kf.info.mutex.RUnlock()
|
defer kf.info.mutex.RUnlock()
|
||||||
|
|
||||||
ref := kf.Keyframes[start:end]
|
ref := kf.Keyframes[start:end]
|
||||||
|
if kf.IsDone {
|
||||||
|
return ref
|
||||||
|
}
|
||||||
|
// make a copy since we will continue to mutate the array.
|
||||||
ret := make([]float64, end-start)
|
ret := make([]float64, end-start)
|
||||||
copy(ret, ref)
|
copy(ret, ref)
|
||||||
return ret
|
return ret
|
||||||
|
Loading…
x
Reference in New Issue
Block a user