[Live-devel] Streamer eats up Cpu.

Ross Finlayson finlayson at live.com
Tue Mar 15 12:55:36 PST 2005

At 11:41 AM 3/15/05, you wrote:
>Thanks. It really helped me to find out the problem:
>I should not give 0 as the first parameter of scheduleDelayedTask() as 
>nextTask() = envir().taskScheduler().scheduleDelayedTask(0,
>    (TaskFunc*)FramedSource::afterGetting, this);
>I have tried 20. It works well. But later, I will calculate a better one.

No, if this code is (as I assume) derived from "DeviceSource.cpp", then you 
should leave the first parameter to "scheduleDelayedTask()" as 0.  But 
instead, you should set "fDurationInMicroseconds" to be the correct 
duration of the frame (in microseconds) - e.g., 20.

Setting the first parameter of the "scheduleDelayedTask()" call to 20 is 
*not* the right thing to do.  (This causes the delivery of the frame to the 
next object in the chain to be delayed 20 us, which in turn will cause the 
next packet to be sent 20 us late.  That is not what you want.  Instead, 
you want to delay 20 us *after* sending the next packet.  Setting 
"fDurationInMicroseconds" to 20 will do this.)

	Ross Finlayson

More information about the live-devel mailing list