diff --git a/modules/audio_output/audiounit_ios.m b/modules/audio_output/audiounit_ios.m index aca7c44de8f3cdcea4921123f56a35f66c94ffa1..e449f6e2eb0c3f36d59daa013b68ae04feedb353 100644 --- a/modules/audio_output/audiounit_ios.m +++ b/modules/audio_output/audiounit_ios.m @@ -402,6 +402,14 @@ Pause (audio_output_t *p_aout, bool pause, vlc_tick_t date) } p_sys->b_stopped = pause; ca_Pause(p_aout, pause, date); + + /* Since we stopped the AudioUnit, we can't really recover the delay from + * the last playback. So it's better to flush everything now to avoid + * synchronization glitches when resuming from pause. The main drawback is + * that we loose 1-2 sec of audio when resuming. The order is important + * here, ca_Flush need to be called when paused. */ + if (pause) + ca_Flush(p_aout, false); } static void