objective-ctimecompareequalscmtime

Check CMTime Equals


Is there any method to check a CMTime is equal to another CMTime. In my case I need to check CMTime is equal to KCMTimeZero. I tried CMTimeCompare method, but it will be True for all the CMTimes which is equal to KCMTimeZero or greater than KCMTimeZero.


Solution

  • I found the following way to check by converting it to seconds

    if(CMTimeGetSeconds(myTime) == CMTimeGetSeconds(kCMTimeZero))
    {
         // do something...     
    }