From 49b3150434ee97fbcee33948053ffbf33a7b5505 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 12 Apr 2006 17:17:23 +0000 Subject: * rename "latency correction" to "write index correction" * add read index invalidation code * rename "ipol_event" stuff to "auto_timing_update" * remove buffer_usec field from pa_timing_info, since it can be easily calculated from write_index and read_index anyway * add read_index_corrupt field to "pa_timing_info", similar to the already existing write_index_corrupt field * restart automatic timing update event every time a query is issued, not just when the last event elapsed * proper invalidation code for pa_stream_flush() * do tarsnport/sink/source latency correction for playback time only when device is not corked git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@686 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/polyp/internal.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/polyp/internal.h') diff --git a/src/polyp/internal.h b/src/polyp/internal.h index 3b85b3d1..2bec0294 100644 --- a/src/polyp/internal.h +++ b/src/polyp/internal.h @@ -83,14 +83,14 @@ struct pa_context { pa_client_conf *conf; }; -#define PA_MAX_LATENCY_CORRECTIONS 10 +#define PA_MAX_WRITE_INDEX_CORRECTIONS 10 -typedef struct pa_latency_correction { +typedef struct pa_index_correction { uint32_t tag; int valid; int64_t value; int absolute, corrupt; -} pa_latency_correction; +} pa_index_correction; struct pa_stream { int ref; @@ -124,13 +124,18 @@ struct pa_stream { /* Use to make sure that time advances monotonically */ pa_usec_t previous_time; - /* Latency correction stuff */ - pa_latency_correction latency_corrections[PA_MAX_LATENCY_CORRECTIONS]; - int idx_latency_correction; + /* time updates with tags older than these are invalid */ + uint32_t write_index_not_before; + uint32_t read_index_not_before; + + /* Data about individual timing update correctoins */ + pa_index_correction write_index_corrections[PA_MAX_WRITE_INDEX_CORRECTIONS]; + int current_write_index_correction; /* Latency interpolation stuff */ - pa_time_event *ipol_event; - int ipol_requested; + pa_time_event *auto_timing_update_event; + int auto_timing_update_requested; + pa_usec_t ipol_usec; int ipol_usec_valid; struct timeval ipol_timestamp; -- cgit