ofVideoPlayer small fixes

ofVideoPlayer deconstructor crashes on osx and probably on windows if the movie file is not found. isFrameNew() always returns false on linux. patch is attached.

  
  
*** openFrameworks/video/ofVideoPlayer.cpp  2008-01-27 17:49:19.000000000 +0100  
--- fix/openFrameworks/video/ofVideoPlayer.cpp   2008-04-04 17:36:23.000000000 +0200  
***************  
*** 219,223 ****  
            int curFrameIndex =  fobsDecoder->getFrameIndex();  
  
!           if (curFrameIndex != lastFrameIndex){  
                unsigned char *rgb = fobsDecoder->getRGB();  
                memcpy(pixels, rgb, width*height*3);  
--- 219,224 ----  
            int curFrameIndex =  fobsDecoder->getFrameIndex();  
  
!           bHavePixelsChanged = curFrameIndex != lastFrameIndex;  
!           if (bHavePixelsChanged) {  
                unsigned char *rgb = fobsDecoder->getRGB();  
                memcpy(pixels, rgb, width*height*3);  
***************  
*** 225,229 ****  
            }  
  
-   
            lastFrameIndex = curFrameIndex;  
  
--- 226,229 ----  
***************  
*** 360,372 ****  
        initializeQuicktime();          // init quicktime  
        closeMovie();                   // if we have a movie open, close it  
!       bLoaded                 = false;    // try to load now  
!         
        if( name.substr(0, 7) == "[http://"){](http://"){)  
!           if(! createMovieFromURL(name, moviePtr) ) return false;  
        }else{  
!           name                    = ofToDataPath(name);  
!           if( !createMovieFromPath((char *)name.c_str(), moviePtr) ) return false;  
        }  
!         
        bool bDoWeAlreadyHaveAGworld = false;  
        if (width != 0 && height != 0){  
--- 360,377 ----  
        initializeQuicktime();          // init quicktime  
        closeMovie();                   // if we have a movie open, close it  
!       bLoaded             = false;    // try to load now  
!   
!       offscreenGWorld = NULL;  
        if( name.substr(0, 7) == "[http://"){](http://"){)  
!           if(! createMovieFromURL(name, moviePtr) ) {  
!               return false;  
!           }  
        }else{  
!           name                    = ofToDataPath(name);  
!           if( !createMovieFromPath((char *)name.c_str(), moviePtr) ) {  
!               return false;  
!           }  
        }  
!   
        bool bDoWeAlreadyHaveAGworld = false;  
        if (width != 0 && height != 0){  
  

Hi - thanks for the patch.
We have already fixed the desconstructor issue for the next release - but the newFrame issue we didn’t know about, we’ll get that sorted too!

Thanks!
Theo

hi Theo,

thanks. i thought i was using the latest version, because i downloaded the svn snapshot from http://www.openframeworks.cc/download. in that version i didn’t find the deconstructor fix. i guess the svn snapshot download contains an older version then.

gabor