diff --git a/audio/out/buffer.c b/audio/out/buffer.c index 87a125e7e89bf..c20920bbb591d 100644 --- a/audio/out/buffer.c +++ b/audio/out/buffer.c @@ -425,19 +425,20 @@ void ao_set_paused(struct ao *ao, bool paused, bool eof) mp_mutex_unlock(&p->lock); - if (do_reset) { - if (ao->driver->set_pause) { + if (ao->driver->set_pause) { + if (do_reset) { ao->driver->set_pause(ao, true); p->end_time_ns -= mp_time_ns(); - } else { - ao->driver->reset(ao); } - } - if (do_start) { - if (ao->driver->set_pause) { + if (do_start) { p->end_time_ns += mp_time_ns(); ao->driver->set_pause(ao, false); - } else { + } + } else { + if (do_reset) { + ao->driver->reset(ao); + } + if (do_start) { ao->driver->start(ao); } }