ao: add ao_stop_streaming

This commit is contained in:
Misaki Kasumi 2024-04-24 08:30:07 +08:00
parent a6a46fa89d
commit 0b8bfbe60d
2 changed files with 12 additions and 0 deletions

View File

@ -268,6 +268,16 @@ int ao_read_data_converted(struct ao *ao, struct ao_convert_fmt *fmt,
return res;
}
// Called by pull-based AO to indicate the AO has stopped requesting more data,
// usually when EOF is got from ao_read_data().
// After this function is called, the core will call ao->driver->start() again
// when more audio data after EOF arrives.
void ao_stop_streaming(struct ao *ao)
{
struct buffer_state *p = ao->buffer_state;
p->streaming = false;
}
int ao_control(struct ao *ao, enum aocontrol cmd, void *arg)
{
struct buffer_state *p = ao->buffer_state;

View File

@ -234,4 +234,6 @@ void ao_wakeup(struct ao *ao);
int ao_read_data_converted(struct ao *ao, struct ao_convert_fmt *fmt,
void **data, int samples, int64_t out_time_ns);
void ao_stop_streaming(struct ao *ao);
#endif