TT#136957 use output PT clock rate instead of encoder clock rate

... for scheduling output RTP packets. This is mostly relevant for DTMF
packets which don't have an associated encoder when being forwarded.

Change-Id: I56ee94a9ac7f42cc65eec0703bf042065687e43f
pull/1421/head
Richard Fuchs 4 years ago
parent 912524abc7
commit f79593ecc9

@ -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?

Loading…
Cancel
Save