Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
e40ed4c4
Commit
e40ed4c4
authored
Dec 11, 2015
by
Felix Paul Kühne
Browse files
vpc: enforce the audio device's reported output latency (closes
#2
)
ATV only for now
parent
b0d912e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Sources/VLCPlaybackController.m
View file @
e40ed4c4
...
...
@@ -237,6 +237,12 @@ NSString *const VLCPlaybackControllerPlaybackPositionUpdated = @"VLCPlaybackCont
if
(
self
.
pathToExternalSubtitlesFile
)
[
_mediaPlayer
openVideoSubTitlesFromFile
:
self
.
pathToExternalSubtitlesFile
];
#if TARGET_OS_TV
/* set audio delay to the default latency of the output device */
self
.
audioDelay
=
[[
AVAudioSession
sharedInstance
]
outputLatency
];
APLog
(
@"Enforcing an audio output latency of %fs"
,
[[
AVAudioSession
sharedInstance
]
outputLatency
]);
#endif
VLCMedia
*
media
;
if
(
_mediaList
)
{
media
=
[
_mediaList
mediaAtIndex
:
_itemInMediaListToBePlayedFirst
];
...
...
@@ -782,6 +788,12 @@ NSString *const VLCPlaybackControllerPlaybackPositionUpdated = @"VLCPlaybackCont
NSArray
*
outputs
=
[[
AVAudioSession
sharedInstance
]
currentRoute
].
outputs
;
NSString
*
portName
=
[[
outputs
firstObject
]
portName
];
#if TARGET_OS_TV
/* adapt audio delay to the default latency of the new output device */
self
.
audioDelay
=
[[
AVAudioSession
sharedInstance
]
outputLatency
];
APLog
(
@"newly enforced audio output latency of %fs"
,
[[
AVAudioSession
sharedInstance
]
outputLatency
]);
#endif
if
(
!
[
portName
isEqualToString
:
@"Headphones"
]
&&
[
_mediaPlayer
isPlaying
])
{
[
_mediaPlayer
pause
];
#if TARGET_OS_IOS
...
...
Thomas Guillem
@tguillem
mentioned in commit
3d16036b
·
Mar 09, 2017
mentioned in commit
3d16036b
mentioned in commit 3d16036b9a74c80e03015d3f0149276f5ca50482
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment