diff --git a/daemon/codec.c b/daemon/codec.c index 1b04adcb4..a6556352e 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -1568,14 +1568,13 @@ static void __output_rtp(struct media_packet *mp, struct codec_ssrc_handler *ch, // this packet is dynamically allocated, so we're able to schedule it. // determine scheduled time to send - if (ch->first_send.tv_sec && ch->encoder_format.clockrate) { + if (ch->first_send.tv_sec && handler->dest_pt.clock_rate) { // scale first_send from first_send_ts to ts p->ttq_entry.when = ch->first_send; uint32_t ts_diff = (uint32_t) ts - (uint32_t) ch->first_send_ts; // allow for wrap-around ts_diff += ts_delay; long long ts_diff_us = - (unsigned long long) ts_diff * 1000000 / ch->encoder_format.clockrate - * ch->handler->dest_pt.codec_def->clockrate_mult; + (unsigned long long) ts_diff * 1000000 / handler->dest_pt.clock_rate; timeval_add_usec(&p->ttq_entry.when, ts_diff_us); // how far in the future is this?