ios – CMTimeCompare如何工作?

CMTimeCompare如何工作? Apple似乎已经从他们的文档中遗漏了返回值.

https://developer.apple.com/library/mac/#documentation/CoreMedia/Reference/CMTime/Reference/reference.html

我假设如果时间相等则返回零并返回正或负1,基于哪个更大?

解决方法

来自CMTime.h:

Returns the numerical relationship (-1 = less than,1 = greater than,
0 = equal) of two CMTimes.

-1 is returned if time1 is less than time2. 0 is returned if they are equal. 1 is returned if time1 is greater than time2.

编辑:

请注意:

Invalid CMTimes are considered to be equal to other invalid CMTimes,and greater than any other CMTime. Positive infinity is considered to be less than any invalid CMTime,equal to itself,and greater than any other CMTime. An indefinite CMTime is considered to be less than any invalid CMTime,less than positive infinity,and greater than any other CMTime. Negative infinity is considered to be equal to itself,and less than any other CMTime.

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...