Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Efficient decoding - replace GetMoviePict



Russ wrote:

But now, I took my code and ran it on a PowerPC iMac running 10.4 and the latest Quicktime, and I see nasty frame mis-ordering problems and some mangled frames where one image has clearly overwritten part of the other. The PPC machine is uni-core; my other machines are Intel multi-core (2 or 8) running 10.5. So the problem may be specific to being on only 1 core, to being a PPC, or to being on 10.4.

Either way, it seems to be a thread-safety issue, which leads to the obvious question: exactly what degree of thread-safety do the Core Video and QTVisualContext calls have? As they are advertised as "modern" I have treated them as thread-safe ...

In case of Carbon programming the answer would be "check the header if the API is marked as thread safe".
In case of QuickTime the answer is "read TN2125".
You are accessing a QT object (the visual context) from more than one thread. That isn't safe without using a mutex (which of course makes threading useless).
You might try opening the movie twice on two background threads and sending the request for a movie pict alternatingly to one thread or the other.

It's very odd since it works nicely on multicore machines where the sequencing can be fairly random and would tend to expose simultaneous-access problems. It seems like maybe 10.4 is buggy, almost like something is saying "we've only got one core so why bother with this mutex stuff" ?!

I would guess that threads get switched out more often on the single core machine which may make the buffer overwriting more likely.

If a bug happens on system 1 and not on system 2 you were probably just lucky on system 2. If system 1 is obsolete, don't think the bug is solved. It may come back to haunt you on system 3.
I recently got a bug report from a user on 10.5.2 followed by a message that "the upgrade to 10.5.3 solved the problem".
Actually the upgrade solved a big performance bug in multiprocessing and my bug is probably still hiding somewhere.

Jan E.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.