mirror of
https://github.com/dirtydishes/dreamio.git
synced 2026-06-06 21:38:15 +00:00
Fix VLC resume audio lag
This commit is contained in:
parent
f0226c651d
commit
ed7a242a47
4 changed files with 409 additions and 4 deletions
|
|
@ -75,6 +75,26 @@ enum NativePlaybackAudioSessionPolicy {
|
|||
}
|
||||
}
|
||||
|
||||
enum NativePlaybackResumePolicy {
|
||||
static let freezeInterval: TimeInterval = 0.08
|
||||
static let maximumFreezeDuration: TimeInterval = 1.2
|
||||
static let maximumAllowedSilentAdvance: Int32 = 120
|
||||
|
||||
static func shouldHoldVideoAtPausedTime(
|
||||
elapsedSinceResume: TimeInterval,
|
||||
hasObservedAudioOutput: Bool,
|
||||
mediaAdvanceMilliseconds: Int32
|
||||
) -> Bool {
|
||||
guard !hasObservedAudioOutput else {
|
||||
return false
|
||||
}
|
||||
guard elapsedSinceResume < maximumFreezeDuration else {
|
||||
return false
|
||||
}
|
||||
return mediaAdvanceMilliseconds > maximumAllowedSilentAdvance
|
||||
}
|
||||
}
|
||||
|
||||
enum NativePlaybackError: LocalizedError {
|
||||
case backendUnavailable
|
||||
case startupTimedOut
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue