Skip to content

Commit

Permalink
audiounit: add IOBufferDuration + kAudioUnitProperty_Latency
Browse files Browse the repository at this point in the history
Still not happy with the A/V sync when using external devices, even with
this commit.
  • Loading branch information
tguillem authored and jbkempf committed Dec 2, 2022
1 parent 621effd commit 8cf10ff
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions modules/audio_output/audiounit_ios.m
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,19 @@ - (NSInteger)removeAoutInstance:(AoutWrapper *)wrapperInstance
{
aout_sys_t *p_sys = p_aout->sys;

vlc_tick_t latency_us =
vlc_tick_from_sec([p_sys->avInstance outputLatency]);
Float64 unit_s;
vlc_tick_t latency_us = 0, us;

msg_Dbg(p_aout, "Current device has a latency of %lld us", latency_us);
us = vlc_tick_from_sec([p_sys->avInstance outputLatency]);
msg_Dbg(p_aout, "Current device has a outputLatency of %" PRId64 "us", us);
latency_us += us;

us = vlc_tick_from_sec([p_sys->avInstance IOBufferDuration]);
msg_Dbg(p_aout, "Current device has a IOBufferDuration of %" PRId64 "us", us);
latency_us += us;

msg_Dbg(p_aout, "Current device has a total latency of %" PRId64 "us",
latency_us);
return latency_us;
}

Expand Down

0 comments on commit 8cf10ff

Please sign in to comment.