summaryrefslogtreecommitdiffstats
path: root/audio/out/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'audio/out/internal.h')
-rw-r--r--audio/out/internal.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/audio/out/internal.h b/audio/out/internal.h
index 5b922657d0..6eb7016f2d 100644
--- a/audio/out/internal.h
+++ b/audio/out/internal.h
@@ -48,12 +48,6 @@ struct ao {
int init_flags; // AO_INIT_* flags
bool stream_silence; // if audio inactive, just play silence
- // Set by the driver on init.
- // This value is in complete samples (i.e. 1 for stereo means 1 sample
- // for both channels each).
- // Used for push based API only.
- int period_size;
-
// The device as selected by the user, usually using ao_device_desc.name
// from an entry from the list returned by driver->list_devices. If the
// default device should be used, this is set to NULL.
@@ -83,7 +77,12 @@ bool init_buffer_post(struct ao *ao);
struct mp_pcm_state {
// Note: free_samples+queued_samples <= ao->device_buffer; the sum may be
// less if the audio API can report partial periods played, while
- // free_samples should be period-size aligned.
+ // free_samples should be period-size aligned. If free_samples is not
+ // period-size aligned, the AO thread might get into a situation where
+ // it writes a very small number of samples in each iteration, leading
+ // to extremely inefficient behavior.
+ // Keep in mind that write() may write less than free_samples (or your
+ // period size alignment) anyway.
int free_samples; // number of free space in ring buffer
int queued_samples; // number of samples to play in ring buffer
double delay; // total latency in seconds (includes queued_samples)