本文整理汇总了C++中Timestamp::msecs方法的典型用法代码示例。如果您正苦于以下问题:C++ Timestamp::msecs方法的具体用法?C++ Timestamp::msecs怎么用?C++ Timestamp::msecs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timestamp
的用法示例。
在下文中一共展示了Timestamp::msecs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
bool Mp3PspStream::seek(const Timestamp &where) {
DEBUG_ENTER_FUNC();
if (where == _length) {
_state = MP3_STATE_EOS;
return true;
} else if (where > _length) {
return false;
}
const uint32 time = where.msecs();
mad_timer_t destination;
mad_timer_set(&destination, time / 1000, time % 1000, 1000);
// Important to release and re-init the ME
releaseStreamME();
initStreamME();
// Check if we need to rewind
if (_state != MP3_STATE_READY || mad_timer_compare(destination, _totalTime) < 0) {
initStream();
}
// Skip ahead
while (mad_timer_compare(destination, _totalTime) > 0 && _state != MP3_STATE_EOS)
findValidHeader();
return (_state != MP3_STATE_EOS);
}
示例2: if
bool MP3Stream::seek(const Timestamp &where) {
if (where == _length) {
_state = MP3_STATE_EOS;
return true;
} else if (where > _length) {
return false;
}
const uint32 time = where.msecs();
mad_timer_t destination;
mad_timer_set(&destination, time / 1000, time % 1000, 1000);
if (_state != MP3_STATE_READY || mad_timer_compare(destination, _totalTime) < 0)
initStream();
while (mad_timer_compare(destination, _totalTime) > 0 && _state != MP3_STATE_EOS)
readHeader();
decodeMP3Data();
return (_state != MP3_STATE_EOS);
}
示例3: msecsDiff
int Timestamp::msecsDiff(const Timestamp &ts) const {
return msecs() - ts.msecs();
}