chiark
/
gitweb
/
~mdw
/
disorder
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
189e983
)
configure playahead in ms
author
Richard Kettlewell
<rjk@greenend.org.uk>
Sun, 23 Sep 2007 12:00:35 +0000
(13:00 +0100)
committer
Richard Kettlewell
<rjk@greenend.org.uk>
Sun, 23 Sep 2007 12:00:35 +0000
(13:00 +0100)
server/speaker.c
patch
|
blob
|
blame
|
history
diff --git
a/server/speaker.c
b/server/speaker.c
index f9badeb28f28f71b38bb32f063ec4caab4f337d6..aa67b4fe92788c1718760f91349e3654506f6f6b 100644
(file)
--- a/
server/speaker.c
+++ b/
server/speaker.c
@@
-106,8
+106,8
@@
*/
#define NETWORK_BYTES 1024
*/
#define NETWORK_BYTES 1024
-/** @brief Maximum RTP playahead (
second
s) */
-#define RTP_AHEAD
1
+/** @brief Maximum RTP playahead (
m
s) */
+#define RTP_AHEAD
_MS 1000
/** @brief Maximum number of FDs to poll for */
#define NFDS 256
/** @brief Maximum number of FDs to poll for */
#define NFDS 256
@@
-971,9
+971,10
@@
int main(int argc, char **argv) {
struct timeval now;
uint64_t target_us;
uint64_t target_rtp_time;
struct timeval now;
uint64_t target_us;
uint64_t target_rtp_time;
- const uint64_t samples_ahead = RTP_AHEAD * config->sample_format.rate
- * config->sample_format.channels;
-
+ const int64_t samples_ahead = ((uint64_t)RTP_AHEAD_MS
+ * config->sample_format.rate
+ * config->sample_format.channels
+ / 1000);
static unsigned logit;
/* If we're starting then initialize the base time */
static unsigned logit;
/* If we're starting then initialize the base time */
@@
-988,7
+989,7
@@
int main(int argc, char **argv) {
* config->sample_format.channels)
/ 1000000;
* config->sample_format.channels)
/ 1000000;
-#if
0
+#if
1
/* TODO remove logging guff */
if(!(logit++ & 1023))
info("rtp_time %llu target %llu difference %lld [%lld]",
/* TODO remove logging guff */
if(!(logit++ & 1023))
info("rtp_time %llu target %llu difference %lld [%lld]",
@@
-996,8
+997,7
@@
int main(int argc, char **argv) {
rtp_time - target_rtp_time,
samples_ahead);
#endif
rtp_time - target_rtp_time,
samples_ahead);
#endif
- if(rtp_time < target_rtp_time
- || rtp_time - target_rtp_time < samples_ahead)
+ if((int64_t)(rtp_time - target_rtp_time) < samples_ahead)
bfd_slot = addfd(bfd, POLLOUT);
break;
}
bfd_slot = addfd(bfd, POLLOUT);
break;
}