- /* FIXME: No need to compute this on every run */
- int mod = conf.ortp_header_interval_arg / (tv2ms(&af->chunk_tv) + 1);
- if (mod && (chunks_sent % mod))
+ static struct timeval last_header;
+ struct timeval now, diff;
+
+ if (!current_chunk)
+ return 0;
+ gettimeofday(&now, NULL);
+ tv_diff(&now, &last_header, &diff);
+ if (tv2ms(&diff) < conf.ortp_header_interval_arg)