device-port: Change the latency offset type to a signed int.

The latency offset type should be signed (int64_t) so we can also add
a negative latency offset.

This also includes changing the type of the sink/source
offsets and updating pacmd so it handles negative numbers.
This commit is contained in:
poljar (Damir Jelić) 2012-06-27 17:38:42 +02:00 committed by Tanu Kaskinen
parent f6e4bfbbc5
commit bf4091dcf8
7 changed files with 40 additions and 20 deletions

View file

@ -114,7 +114,7 @@ struct pa_sink {
pa_atomic_t mixer_dirty;
/* The latency offset is inherited from the currently active port */
pa_usec_t latency_offset;
int64_t latency_offset;
unsigned priority;
@ -272,7 +272,7 @@ struct pa_sink {
pa_usec_t fixed_latency; /* for sinks with PA_SINK_DYNAMIC_LATENCY this is 0 */
/* This latency offset is a direct copy from s->latency_offset */
pa_usec_t latency_offset;
int64_t latency_offset;
/* Delayed volume change events are queued here. The events
* are stored in expiration order. The one expiring next is in
@ -410,7 +410,7 @@ unsigned pa_device_init_priority(pa_proplist *p);
/**** May be called by everyone, from main context */
pa_bool_t pa_sink_update_rate(pa_sink *s, uint32_t rate, pa_bool_t passthrough);
void pa_sink_set_latency_offset(pa_sink *s, pa_usec_t offset);
void pa_sink_set_latency_offset(pa_sink *s, int64_t offset);
/* The returned value is supposed to be in the time domain of the sound card! */
pa_usec_t pa_sink_get_latency(pa_sink *s);