mirror of
https://github.com/dirtydishes/dreamio.git
synced 2026-06-06 21:38:15 +00:00
Fix VLC resume audio sync
This commit is contained in:
parent
ed7a242a47
commit
e7ddd6d755
6 changed files with 331 additions and 118 deletions
|
|
@ -75,23 +75,11 @@ enum NativePlaybackAudioSessionPolicy {
|
|||
}
|
||||
}
|
||||
|
||||
enum NativePlaybackResumePolicy {
|
||||
static let freezeInterval: TimeInterval = 0.08
|
||||
static let maximumFreezeDuration: TimeInterval = 1.2
|
||||
static let maximumAllowedSilentAdvance: Int32 = 120
|
||||
enum NativePlaybackStreamingOptionsPolicy {
|
||||
static let networkCachingMilliseconds = 1000
|
||||
|
||||
static func shouldHoldVideoAtPausedTime(
|
||||
elapsedSinceResume: TimeInterval,
|
||||
hasObservedAudioOutput: Bool,
|
||||
mediaAdvanceMilliseconds: Int32
|
||||
) -> Bool {
|
||||
guard !hasObservedAudioOutput else {
|
||||
return false
|
||||
}
|
||||
guard elapsedSinceResume < maximumFreezeDuration else {
|
||||
return false
|
||||
}
|
||||
return mediaAdvanceMilliseconds > maximumAllowedSilentAdvance
|
||||
static func mediaOptions() -> [String] {
|
||||
[":network-caching=\(networkCachingMilliseconds)"]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue