Don't skip segments that start before 4 seconds

To minimize buffering
This commit is contained in:
Arkadiusz Fal 2022-05-21 21:47:51 +02:00
parent bdc83a7e7c
commit bf46c36eca
2 changed files with 3 additions and 2 deletions

View File

@ -128,7 +128,7 @@ final class MPVBackend: PlayerBackend {
if !preservingTime, if !preservingTime,
let segment = self.model.sponsorBlock.segments.first, let segment = self.model.sponsorBlock.segments.first,
segment.start < 3, segment.start > 4,
self.model.lastSkipped.isNil self.model.lastSkipped.isNil
{ {
self.seek(to: segment.endTime) { finished in self.seek(to: segment.endTime) { finished in

View File

@ -50,7 +50,8 @@ extension PlayerModel {
private func shouldSkip(_ segment: Segment, at time: CMTime) -> Bool { private func shouldSkip(_ segment: Segment, at time: CMTime) -> Bool {
guard isPlaying, guard isPlaying,
!restoredSegments.contains(segment), !restoredSegments.contains(segment),
Defaults[.sponsorBlockCategories].contains(segment.category) Defaults[.sponsorBlockCategories].contains(segment.category),
segment.start > 4
else { else {
return false return false
} }