Logo Search packages:      
Sourcecode: scummvm version File versions

void Audio::Timestamp::normalize (  ) [protected]

Normalize this timestamp by making _numFrames non-negative and reducing it modulo _framerate.

Definition at line 76 of file timestamp.cpp.

References _framerate, _numFrames, and _secs.

Referenced by addFrames(), addIntern(), addMsecs(), convertToFramerate(), and Timestamp().

                          {
      // Convert negative _numFrames values to positive ones by adjusting _secs
      if (_numFrames < 0) {
            int secsub = 1 + (-_numFrames / _framerate);

            _numFrames += _framerate * secsub;
            _secs -= secsub;
      }

      // Wrap around if necessary
      _secs += (_numFrames / _framerate);
      _numFrames %= _framerate;
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index