quicktime-java
[Prev] Thread [Next] | [Prev] Date [Next]
Re: QTJAVA still crash randomly Rolf Howarth Tue Dec 02 07:01:06 2008
That sounds like a lot of work. Here is my list of tips and suggestions:1. Don't create extra threads unless you're really, really sure you need them. Thead programming is hard, often unnecessary, and remember that QuickTime isn't thread safe.
2. If you don't have any other threads using QuickTime and are just doing regular stuff to play a single movie (open a movie, create a QT component, display it) then you should be fine just doing that from the event loop without any other precautions.
3. If you're doing a lot of QuickTime manipulation (opening many movies, iterating over tracks, reading metadata, building movies, etc.) then try to do all that from a single thread (either the event loop or a single background worker thread with a queue of things to do).
4. If you're worried about QuickTime keeping files open, or are creating huge numbers of QT objects so that you might run out of memory, explicitly call disposeQTObject() on your movies and other major objects yourself when you're finished with them. Otherwise, don't bother and let the GC free them up.
5. Unless your requirements are very simple (eg. hint 2), it's a good idea to protect code that does QuickTime manipulation inside a synchronized block to prevent the finalizer thread invoking native QT calls to free up the QT objects at exactly the same time as your code (which can result in crashes, as QT isn't thread safe):
synchronized(QTSession.terminationLock())
{
...
}
There should be no need to reinvent the Java garbage collector and
finalizer mechanism though.
-Rolf At 00:22 +0000 1/12/08, orlando marquina wrote:
Hi everybody in this list, my respects to all of you. I know, this problem was responded in many treads before, but still happened to me, sorry but I dont find any solution to my problem, and I have time along with it.I build an app with a custom video player, that reproduce a Playlist without human intervention, that use a ImageProducer class, like the example of the quicktime for java page, this is not the only GUI element, the others are images and fonts(SWING),plus other threads for others functions in the app, and I use the QuicktimeDisposer class, recomended in this mail list, to dispose the video after reproduction, but the app still crash on Windows, with the errors in native code, some times ntdll.dll, other times with mp4 errors, etc.The QuicktimeDisposer, is a class wich make a queue of qtobjects, and dispose those objects and after dispose call System.gc. Do I desable the garbage collector in the VM, and to give the control to this class, only?, or any body, knows how control this problem?.Is a mistake in my code, or bad thread programming?Please anybody, who were builded and completed and controlled the crash problem, in applications that have to run per hours; updating per internet, using jdbc connections (to Mysql DB) and simultaneosly treads for other jobs, please extend me a hand.Any recomendations, or other type of help, any guide, or link, please I beg any type of help.Thanks. _______________________________________________ Do not post admin requests to the list. They will be ignored. QuickTime-java mailing list ([EMAIL PROTECTED]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quicktime-java/rolf%40squarebox.co.uk This email sent to [EMAIL PROTECTED]
-- Rolf Howarth Square Box Systems Ltd Stratford-upon-Avon, UK. http://www.squarebox.co.uk _______________________________________________ Do not post admin requests to the list. They will be ignored. QuickTime-java mailing list ([EMAIL PROTECTED]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quicktime-java/alexiscircle%40gmail.com This email sent to [EMAIL PROTECTED]
- QTJAVA still crash randomly orlando marquina
- RE: QTJAVA still crash randomly George Birbilis
- Re: QTJAVA still crash randomly Rolf Howarth <=
- Message not available
- Message not available
- Re: QTJAVA still crash randomly Rolf Howarth
- Message not available
- Message not available
- Re: QTJAVA still crash randomly Duncan McGregor