What I would like to do is this:
- play a master quicktime movie (prores or pjpg) on one screen (with audio)
- play another slave quicktime movie (prores or pjpg) on another screen, in-sync with the master
- when i press left or right, cycle through different slave movies
This is what i've done:
- create an NSWindow for each screen
- create an array of QTMovies (actually an array of arrays per screen)
- create an array of QTMovieViews (actually an array of arrays per screen)
- play the master QTMovie normally
- setup an NSTimer to update the current slave movie time from the master movies time
- if a key is pressed, swap the content view of the window to the new QTMovieView
my full code is at http://codepad.org/gDsJLPAy
It all works, however when I switch videos, I get a single frame flash of the old frame of the video being switched to. I.e. if I run the app for 50 frames and switch to SlaveVideo2, I catch a glimpse of SlaveVideo2 frame 0, and then it immediately jumps to SlaveVideo2 frame 50 and carries on as usual. If, after 20 frames I switch back to SlaveVideo1 I catch a glimpse of SlaveVideo1 frame 50, and then it jumps to SlaveVideo1 frame 70 and carries on as usual.
I'm going crazy trying to figure this out. I've tried all kinds of refresh, display methods but to no avail. Any ideas on how I can fix this?
P.S. You can see in the timerFireMethod if I update all slave movies all the time (instead of just the active one), I don't get the flicker. Obviously this isn't a solution since I'm constantly seeking tons of videos which is way too heavy and unnecessary!
P.P.S. I've tried recreating the setup in Quartz Composer and I get the exact same problem.
I'm on 10.7.3