[AG-DEV] UCL common lib rtp_recv & frame timing

Rhys Hawkins rhys.hawkins at anu.edu.au
Tue Jul 27 19:17:31 CDT 2010


On Tue, 27 Jul 2010 14:12:37 -0400
Andrew Ford <andrew.ford at rit.edu> wrote:

> 
>   timeout.tv_sec = 0;
>   timeout.tv_usec = 10000;
>   for (int i = 0; i < 1000 && rtp_recv(session, &timeout, _timestamp); i ++) {
> 
> 
>     timeout.tv_sec = 0;
>     timeout.tv_usec = 10;
> 
>   }				
> 

Hi Andrew,

All that code is doing is a crude version of:
  
  while (elapsed_time < 10ms) {
    process incoming packets
  }

You could try and replace the for loop with just one call to the rtp_recv
function, ie:

  timeout.tv_sec = 0;
  timeout.tv_usec = 10000;
  rtp_recv(session, &timeout, _timestamp);

and see if that fixes your problem.

The code above was to handle an issue with DV decoding in that decoding an 
entire frame of DV took a certain length of time and during that time the
UDP buffer (kernel side) could overflow causing loss of data. I don't think
it should be the cause of your problems, but things are pretty foggy that
far back in time so it may have other ramifications I've forgotten about.

Cheers,
    Rhys


More information about the ag-dev mailing list