Re: Quicktime and NSThread
Re: Quicktime and NSThread
- Subject: Re: Quicktime and NSThread
- From: Iikka Virkkunen <email@hidden>
- Date: Thu, 22 May 2003 10:58:58 +0300
Nothing obvious. QuickTime is mostly single-threaded, however, so it is
probably getting confused when you try to play from a thread that
didn't
first touch QuickTime. NSMovieView is also known to be pretty buggy
- more advice deleted -
-mc
Great answer Mike, thanks.
Your insight was correct on the threads confusing the movie tasking.
However, I did not want to follow your advice on calling MovieTask
repeatedly. I figured NSMovieView is probably doing something similar,
so I would be creating unnecessary overhead by doubling this effort. So
I did a little research and the trouble seemed to be with setting up
the movieView (not about who first touched Quicktime). The NSMovieView
was set up in the end of the detached thread by calling
NSMovie *myNSMovie =[[[NSMovie alloc]initWithMovie:myMovie]
autorelease];
[movieView setMovie: myNSMovie];
So, what probably happened is, that NSMovieView set up the movie
tasking in a thread that exited shortly after, and that effort was lost.
To correct this issue I moved set up of the NSMovieView to another
method, and called this method in the end of the detached thread by:
[self performSelectorOnMainThread:@selector(movieDidChange:)
withObject:nil
waitUntilDone:NO];
So now the NSMovie is set up in the main thread and everything seems to
be working just great.
Iikka Virkkunen
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.