rtpsource: get clock-rate from pt if needed to generate SR

https://bugzilla.gnome.org/show_bug.cgi?id=780105
This commit is contained in:
Miguel París Díaz 2017-03-15 18:58:55 +01:00 committed by Sebastian Dröge
parent b1ba5f10ce
commit 54a2f33e47
2 changed files with 17 additions and 0 deletions

View file

@ -304,6 +304,8 @@ rtp_source_init (RTPSource * src)
src->last_keyframe_request = GST_CLOCK_TIME_NONE; src->last_keyframe_request = GST_CLOCK_TIME_NONE;
rtp_source_reset (src); rtp_source_reset (src);
src->pt_set = FALSE;
} }
void void
@ -1277,6 +1279,13 @@ rtp_source_send_rtp (RTPSource * src, RTPPacketInfo * pinfo)
if (!update_receiver_stats (src, pinfo, FALSE)) if (!update_receiver_stats (src, pinfo, FALSE))
return GST_FLOW_OK; return GST_FLOW_OK;
if (src->pt_set && src->pt != pinfo->pt) {
GST_WARNING ("Changing pt to %u for SSRC %u", src->ssrc, pinfo->pt);
}
src->pt = pinfo->pt;
src->pt_set = TRUE;
/* update stats for the SR */ /* update stats for the SR */
src->stats.packets_sent += pinfo->packets; src->stats.packets_sent += pinfo->packets;
src->stats.octets_sent += pinfo->payload_len; src->stats.octets_sent += pinfo->payload_len;
@ -1482,6 +1491,12 @@ rtp_source_get_new_sr (RTPSource * src, guint64 ntpnstime,
GST_DEBUG ("last_rtime %" GST_TIME_FORMAT ", last_rtptime %" GST_DEBUG ("last_rtime %" GST_TIME_FORMAT ", last_rtptime %"
G_GUINT64_FORMAT, GST_TIME_ARGS (src->last_rtime), t_rtp); G_GUINT64_FORMAT, GST_TIME_ARGS (src->last_rtime), t_rtp);
if (src->clock_rate == -1 && src->pt_set) {
GST_INFO ("no clock-rate, getting for pt %u and SSRC %u", src->pt,
src->ssrc);
get_clock_rate (src, src->pt);
}
if (src->clock_rate != -1) { if (src->clock_rate != -1) {
/* get the diff between the clock running_time and the buffer running_time. /* get the diff between the clock running_time and the buffer running_time.
* This is the elapsed time, as measured against the pipeline clock, between * This is the elapsed time, as measured against the pipeline clock, between

View file

@ -199,6 +199,8 @@ struct _RTPSource {
gboolean send_nack; gboolean send_nack;
GArray *nacks; GArray *nacks;
gboolean pt_set;
guint8 pt;
}; };
struct _RTPSourceClass { struct _RTPSourceClass {