audio: fix lack of reinitialization on format change with pull AOs

uau did some investigation and noticed that we do not send a wakeup
event when we encounter end-of-stream in ao_read_data(), in contrast to
the equivalent logic for push AOs in ao_play_data().

Inserting that wakeup fixes the original problem of lack of
reinitialization on a format change without the problems we saw with
the previous attempted fix.

Fixes #10566
This commit is contained in:
Philip Langdale 2022-08-23 09:59:32 -07:00 committed by Philip Langdale
parent e2e8c21be4
commit ed7717298b
1 changed files with 1 additions and 0 deletions

View File

@ -193,6 +193,7 @@ int ao_read_data(struct ao *ao, void **data, int samples, int64_t out_time_us)
if (pos < samples && p->playing && !p->paused) {
p->playing = false;
ao->wakeup_cb(ao->wakeup_ctx);
// For ao_drain().
pthread_cond_broadcast(&p->wakeup);
}