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



Well that explains SOME of the problem. All the files are .mp3 files, and yes, I have tested it by running the same file through a bunch of times and it is fine the fist few times.

In a pervious version of my software I used the old GetMediaSamples and a SoundConvereter to play .mp3 files with no problem (other than being very ugly and complicated) in a multi-threaded environment. I assume that under the hood of the SoundConverter, the same QT .mp3 component was being used, so I was thinking that it should be fine under the new API too. Is this a reasonable assumption?

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
_______________________________________________
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>)
 >Re: ComponentNotThreadSafeErr (From: Daniel Steinberg <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.