[FFmpeg-cvslog] r10930 - trunk/libavformat/rtp.c
Michael Niedermayer
michaelni
Mon Nov 5 15:39:15 CET 2007
On Mon, Nov 05, 2007 at 01:25:10PM +0100, lucabe wrote:
> Author: lucabe
> Date: Mon Nov 5 13:25:10 2007
> New Revision: 10930
>
> Log:
> Do not send too many RTCP packets (according to the RFC, the minimum
> distance between two consecutive RTCP packets is 5s)
>
>
> Modified:
> trunk/libavformat/rtp.c
>
> Modified: trunk/libavformat/rtp.c
> ==============================================================================
> --- trunk/libavformat/rtp.c (original)
> +++ trunk/libavformat/rtp.c Mon Nov 5 13:25:10 2007
> @@ -802,6 +802,7 @@ static void rtcp_send_sr(AVFormatContext
> #endif
>
> if (s->first_rtcp_ntp_time == AV_NOPTS_VALUE) s->first_rtcp_ntp_time = ntp_time;
> + s->last_rtcp_ntp_time = ntp_time;
> rtp_ts = av_rescale_q(ntp_time - s->first_rtcp_ntp_time, AV_TIME_BASE_Q,
> s1->streams[0]->time_base) + s->base_timestamp;
> put_byte(&s1->pb, (RTP_VERSION << 6));
> @@ -984,7 +985,8 @@ static int rtp_write_packet(AVFormatCont
> /* XXX: mpeg pts hardcoded. RTCP send every 0.5 seconds */
> rtcp_bytes = ((s->octet_count - s->last_octet_count) * RTCP_TX_RATIO_NUM) /
> RTCP_TX_RATIO_DEN;
> - if (s->first_packet || rtcp_bytes >= RTCP_SR_SIZE) {
> + if (s->first_packet || ((rtcp_bytes >= RTCP_SR_SIZE) &&
> + (av_gettime() - s->last_rtcp_ntp_time > 5000000))) {
if your goal is to prevent 2 packets from hitting the other computer within
5sec then it might be better to use a value larger then 5sec
just think what happens if one packet gets delayed by 500ms
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I wish the Xiph folks would stop pretending they've got something they
do not. Somehow I fear this will remain a wish. -- M?ns Rullg?rd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20071105/07a15917/attachment.pgp>
More information about the ffmpeg-cvslog
mailing list