Using ev_periodic with a custom loop and a specific start time

Marc Lehmann schmorp at schmorp.de
Thu Apr 9 05:22:12 CEST 2009


On Wed, Apr 08, 2009 at 03:56:27PM +0200, Luca Barbato <lu_zero at gentoo.org> wrote:
>> when you want to play somehting at a specific (wallclock) time, but your
>> problem sounds more like requiring specific inter-packet delays, in which
>> case an ev_timer would be the right thing (it isn't affected by time jumps).
>
> The problem is that we need both. The rtsp play receives (among the  
> other things) a time reference about when to start playing, then you are  
> supposed to send packets at variable delays, I just used an ev_periodic  
> to do both...

If it works for you, I don't complain. The question is will you be happy
when your program incures delay differences just because somebody (evil
cron) ran ntpdate?

If that's an issue, using a periodic to start a timer to do the job is the
safer thing to do.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      pcg at goof.com
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list