[Live-devel] blur images vs frames order incorrect

Ross Finlayson finlayson at live.com
Mon Feb 7 11:54:07 PST 2005


>        else
>         {
>             //Unlocked but no new frame
>             if (delayedTaskTime == 0)
>                 delayedTaskTime = (1.0/fps) * 1000000;
>
>             //Maybe in half of the fps I will have a new frame
>             delayedTaskTime = delayedTaskTime / 2;
>             fDurationInMicroseconds = delayedTaskTime;
>         }
>
>        nextTask() =
>envir().taskScheduler().scheduleDelayedTask(delayedTaskTime,
>(TaskFunc*)afterGetting,this);

The "else" branch is a mistake.  You should not call "afterGetting" until 
you have actually satisfied the client's request (by copying data to "fTo", 
and setting "fFrameSize" etc. - i.e., by calling "deliverFrame()").

In the "else" case, instead of arranging to call "afterGetting", you should 
be arranging to call "doGetNextFrame()" again.  I.e., you should be 
arranging to call a function "retryDelivery", where "retryDelivery" is 
something like the following:
         void retryDelivery(M4VSource* source) {
                 source->doGetNextFrame();
         }
Also, there's no need to set "fDurationInMicroseconds" in the "else" case 
above.


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



More information about the live-devel mailing list