ofxFileDialog / OpenGL / ofvideoplayer issue (OSX)

I’m developing a program, for OSX, that is playing back a movie using ofvideoplayer, on an OpenGL based screen. I want to be able to change the movie playing, using a file dialog screen.

The issue I’m having is that when I use an ofxFileDialog object (from http://www.underdoeg.com), the dialog pops up fine, but the movie that is playing pauses until I come out of the dialog. I want the video playback to keep going while I’m selecting a new file.

A secondary issue is occuring where if I select a .mov file with the file dialog, even though I’m not yet using the output from the file dialog object, the movie playback stops completely. If I then open a file again, when I come out of the file dialog my stopped movie then jumps to a different frame. It appears as if the update routine is getting interrupted by the ofxFileDialog code.

I feel like this is something to do with thread locking, and the quicktime API or the NSApplication objects in Objective C that the ofxFileDialog has to use to bring up and OSX file dialog, but I’m not really sure where to start trouble shooting.

The important thing for me here is being able to select a new video, without interrupting playback of the video that is currently playing, but I don’t want to hard-code video file names so a file dialog is pretty essential.

Does anyone have any ideas/experience from similar projects?

Try opening the dialog in a separate thread.

Yup, which is what I was thinking, but not sure where to start.

Would ofxThread be the right direction do you think ?

bingo

Cheers! I know what I’m doing after wrapping presents later :smiley:

Well, I’ve tried using ofxThread to execute the file dialog separately but it still halts the movie playback.

I think this could be something to do with the way the file dialog is objective C wrapped so that OF can access it via C++, and that it actually needs to be told to execute on a separate thread from the objective C code in the file dialog source.

I’m clueless with objective C though… *So* frustrated now! :frowning:

Hmmn… I am running in to similar issues. I posted about them here: http://forum.openframeworks.cc/t/ofvideoplayer-±ofxfiledialogosx-mysterious-pausestop/6515/0

Did you happen to come up with any solutions?