summaryrefslogtreecommitdiff
path: root/ratox.c
diff options
context:
space:
mode:
Diffstat (limited to 'ratox.c')
-rw-r--r--ratox.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ratox.c b/ratox.c
index b57b2a0..4d31fb6 100644
--- a/ratox.c
+++ b/ratox.c
@@ -600,11 +600,11 @@ sendfriendcalldata(struct friend *f)
clock_gettime(CLOCK_MONOTONIC, &now);
diff = timediff(f->av.lastsent, now);
- if (diff.tv_nsec == 0 && diff.tv_nsec < toxavconfig.audio_frame_duration * 1E6) {
+ if (diff.tv_sec == 0 && diff.tv_nsec < toxavconfig.audio_frame_duration * 1E6) {
diff.tv_nsec = toxavconfig.audio_frame_duration * 1E6 - diff.tv_nsec;
nanosleep(&diff, NULL);
}
- f->av.lastsent = now;
+ clock_gettime(CLOCK_MONOTONIC, &f->av.lastsent);
toxav_send_audio(toxav, f->av.num, f->av.payload, payloadsize);
}