Technical Q&As


QTMTB 45 - Handling of Update Events While a Movie Plays (15-Sept-95)


Q We are writing a screen saver that plays QuickTime movies. Our WaitNextEvent loop and code is very basic. We have noticed that other background applications don't get any time, even if we use WaitNextEvent and make sure MoviesTask does not spend too much time playing the movie. However, if we add code to track the updateEvents with BeginUpdate and EndUpdate the problem is gone. Why?

A QuickTime and other parts are sending update events to your application. If these update events are not handled, they are resent, resulting in no time yield to other applications.

By calling BeginUpdate/EndUpdate or otherwise taking care of the update event inside your WaitNextEventLoop, you allow yielding to other applications.
See Technote TB 37 Pending Update Perils, which discusses this situation

Technical Q&As
Previous Question | Contents | Next Question