Thanks for the response.
I did indeed find the link to liners, but the source is not included in that download…it’s the app, movies and xml only…
I basically did the equivalent of the sleep method in the end (I had two performances last week and needed a quick fix) - since I was using midi input I blocked midi messages coming faster than 0.1 secs…
And I added an idleMovie…not entirely sure why this helps, but it does:
//--------------------------------------------------------------
void moviePlayer::cueMovie() {
//reset the threading flag
goMovie = false;
//if it's a different movie...
if(currentMovie != nextMovie) {
//I dont' know why but the idleMovie here seems to help???
(movies[nextMovie]).idleMovie();
(movies[currentMovie]).idleMovie();
//start the new movie rolling and pause the old one
(movies[nextMovie]).setPaused(false);
(movies[currentMovie]).setPaused(true);
//update the current movie
currentMovie = nextMovie;
}
}
It’s been pretty hard to debug the exact problem, since when it crashes generally it just hangs…occasionally however the Xcode debug points to (ofQtUtils.cpp):
...
//----- argb->rgb
for (int i = 0; i < h; i++){
pix24 * rgbPtr = (pix24 *) rgbPixels + ((i) * w);
for (int j = 0; j < w; j++){
rgbaStart = (unsigned char *)rgbaPtr;
memcpy (rgbPtr, rgbaStart+1, sizeof(pix24));
rgbPtr++;
rgbaPtr++; // pointing to this line here...
}
}
...
Which makes me think that the mutex is working fine on the flag I’m using to change movies, but the ofVideoPlayer is still doing this transformation from argb to rgb and then suddenly you change movies and the MoviePtr just isn’t where it was anymore…
…So I’m thinking that extending/making a different version of the ofVideoPlayer that either has a simple flag (that can be checked before trying to change videos), or more likely some event based callback method where it doesn’t try to change movies unless it’s finished processing a frame would be better…
I kind of think an event based ofVideoPlayer would be neat: it would work better for loading movies on the fly too, since you could have callbacks for when the movie was loaded, playing, stopped, etc.
I’ll be having a go and posting results…
M