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: ComponentNotThreadSafeErr



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


At 9:51 AM -0700 5/23/06, Ethan Funk wrote:
I am opening a movie in a thread using:

err = EnterMoviesOnThread(kQTEnterMoviesFlagDontSetComponentsThreadMode);
err = NewMovieFromProperties(3, propArray, 0, NULL, &movie);


I then set the movie active, detach it from this thread, pass it off to another worker thread, and ExitMoviesOnThread from this thread.

Everything is fine the first few time I do this. Then, all subsequent runs through the code causes NewMovieFromProperties to return a "ComponentNotThreadSafeErr" with movie set to NULL.

1. How is this possible with the kQTEnterMoviesFlagDontSetComponentsThreadMode flag set on the previous EnterMoviesOnThread call?
2. Why is it fine the first two or three times through. (Note: each time the movies tried are .mp3 files)


Thanks,
Ethan...
_______________________________________________
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
References: 
 >ComponentNotThreadSafeErr (From: Ethan Funk <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.