Using ev_periodic with a custom loop and a specific start time
lu_zero at gentoo.org
Wed Apr 8 02:03:51 CEST 2009
Marc Lehmann wrote:
> On Mon, Apr 06, 2009 at 06:49:25PM +0200, Luca Barbato <lu_zero at gentoo.org> wrote:
>> the result is strange:
> what is MPA? the current time? and duration?
mpa and h264 are two different rtp streams (audio and video), each of
them has an ev_periodic callback sending a packet.
each packet has a timestamp/mtime that tell when it should be played and
a duration that tells for how much.
>> the H264 packet with mtime 0.04 is sent before the mpa one with mtime
> what is mtime here? libev doesn't have n mtime in it's watchers, so it is
> unclear to me what your problem is.
basically every time the callback gets called a packet is took from a
queue, it's duration value is used to set the next time the callback
will be called by using ev_periodic_set and then issuing
ev_periodic_again within the callback.
> if you are wondering about the order of execution fo the callbacks, then note
> that this is undefined. if you need a timer to execute before another timer
> when both become pending at the same time, you need to use priorities.
is there a recipe for that already?
>> 0.02 even if it is scheduled before and it's deadline is between the 4th
>> and the 5th packet same goes for the following ones.
> It is not at all clear to me what this refers to in terms of libev.
> Could you make a single example of how two peridiocs were configured, how
> they were executed, and how that differes from what you expect?
I wrote a bare loop that is more or less what I'd like to archive and I
got the behavior I'd expect so I guess there is something wrong
somewhere else in the code, sorry for the noise =)
Gentoo Council Member
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1341 bytes
Desc: not available
More information about the libev