X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/7aa087a7e0f7829c8c6778fa420e0b5df0d0ca77..189e98302534f1bf59c7ed0b29ba6dd025b45fc1:/server/speaker.c diff --git a/server/speaker.c b/server/speaker.c index c5fc668..f9badeb 100644 --- a/server/speaker.c +++ b/server/speaker.c @@ -107,7 +107,7 @@ #define NETWORK_BYTES 1024 /** @brief Maximum RTP playahead (seconds) */ -#define RTP_AHEAD 2 +#define RTP_AHEAD 1 /** @brief Maximum number of FDs to poll for */ #define NFDS 256 @@ -971,8 +971,8 @@ int main(int argc, char **argv) { struct timeval now; uint64_t target_us; uint64_t target_rtp_time; - const uint64_t ahead = RTP_AHEAD * config->sample_format.rate - * config->sample_format.channels; + const uint64_t samples_ahead = RTP_AHEAD * config->sample_format.rate + * config->sample_format.channels; static unsigned logit; @@ -988,14 +988,16 @@ int main(int argc, char **argv) { * config->sample_format.channels) / 1000000; +#if 0 /* TODO remove logging guff */ if(!(logit++ & 1023)) info("rtp_time %llu target %llu difference %lld [%lld]", rtp_time, target_rtp_time, rtp_time - target_rtp_time, - ahead); + samples_ahead); +#endif if(rtp_time < target_rtp_time - || rtp_time - target_rtp_time < ahead) + || rtp_time - target_rtp_time < samples_ahead) bfd_slot = addfd(bfd, POLLOUT); break; }