[Live-devel] Streamer eats up Cpu

Ross Finlayson finlayson at live.com
Tue Mar 15 16:58:53 PST 2005


>    // If there is no compressed sound data
>     if (UnitNum==0){
>         nextTask() = envir().taskScheduler().scheduleDelayedTask(
>             PktGapUSec,(TaskFunc*)FramedSource::afterGetting, this);
>         return; // now PktGapUSec=20
>     };

This is wrong.  You should call (or arrange to call) 
"FramedSource::afterGetting()" *only* if you have actually delivered data 
to the client (i.e., after you have set "fFrameSize", and delivered data to 
the location pointed to by "fTo").

In your case, it seems that what you're really trying to do is poll - i.e., 
if no data is available now, then arrange to try again some time (e.g., 20 
us) later.  But that's not what you're doing.

Using WindowsAudioInputDevice as a model is a good idea, but perhaps if 
your "audio recorder" is an actual Windows audio device, then you could use 
the actual "WindowsAudioInputDevice" implementation (mixer or non-mixer), 
rather than just using it as a model??

In any case, for a custom application like this, I'm not sure how much 
support I can continue to give you for free on this mailing list.  If your 
company is interested in having me consult with you on this project, please 
let me know (by separate email).


	Ross Finlayson
	LIVE.COM
	<http://www.live.com/>



More information about the live-devel mailing list