I'll look into using CSSetComponentsThreadMode.
Ethan...
On May 23, 2006, at 10:34 AM, Daniel Steinberg wrote:
Ethan:
The MP3 importer is not currently marked thread-safe. I would
expect NewMovieFromProperties to return ComponentNotThreadSafeErr
for such movies. What is surprising is that it appeared to work
the first few times. Are you sure that the first input files were
.mp3 files? What if you try opening one of the files that fails as
the first file?
By the way, the description of Component Manager thread modes in
TechNote 2125 <http://developer.apple.com/technotes/tn/tn2125.html>
is about as confusing as they come. However, after several
readings, i believe that the relevant passage is this:
"By including the kQTEnterMoviesFlagDontSetComponentThreadMode
flag in the call to
EnterMoviesOnThread, no change to the thread mode will be made
leaving it as it was
before the call. Setting the thread mode is a convenience provided by
EnterMoviesOnThread and can be done directly using
CSSetComponentsThreadMode.
You can also get the current thread mode by calling
CSGetComponentsThreadMode."
In other words, setting the flag does not have the effect of
allowing non-thread-safe components to be called. It merely leaves
the previous state unchanged. You might have more luck if you use
CSSetComponentsThreadMode, but you're on your own since we don't
guarantee the thread-safety of any component not marked as such.
We expect to provide a thread-safe MP3 importer eventually, but in
any event your code should be prepared for *some* importer to fail
on the thread, and fall back to opening the movie on the main
thread..
Daniel Steinberg
QuickTime Engineering