Created
September 21, 2015 06:59
-
-
Save trentbrooks/f8a0bd42334c12890083 to your computer and use it in GitHub Desktop.
ofAVFoundationVideoPlayer previousFrame() replacement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef __OBJC__ | |
ofAVFoundationVideoPlayer* p = (ofAVFoundationVideoPlayer*)videoPtr->getAVFoundationVideoPlayer(); | |
if(p != nullptr) { | |
double timeSec = CMTimeGetSeconds([p getCurrentTime]) - (1.0/[p getFrameRate]); | |
CMTime time = CMTimeMakeWithSeconds(timeSec, NSEC_PER_SEC); | |
[p seekToTime:time withTolerance:kCMTimeZero]; | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment