Skip to content

Commit

Permalink
ao: simplify ao_set_paused
Browse files Browse the repository at this point in the history
  • Loading branch information
ruihe774 committed Mar 26, 2024
1 parent 089f209 commit 9b63482
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions audio/out/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 9b63482

Please sign in to comment.