void Player::setStartFrame(ULONG startFrame)
{
- currentFrameNumber = startFrame;
+ ULONG nextiframeNumber;
+ ULONG iframeLength;
+ ULONG iframeNumber;
+ ULLONG filePos;
+
+ // newFrame could be anywhere, go forwards to next I-Frame
+ if (!vdr->getNextIFrame(startFrame, 1, &filePos, &nextiframeNumber, &iframeLength)) return;
+
+ // Now step back a GOP. This ensures we go to the greatest I-Frame equal to or less than the requested frame
+ vdr->getNextIFrame(nextiframeNumber, 0, &filePos, &iframeNumber, &iframeLength);
+
+ logger->log("Player", Log::DEBUG, "setStartFrame %lu %lu %lu", startFrame, nextiframeNumber,iframeNumber);
+ currentFrameNumber = iframeNumber;
+
}
void Player::setLengthBytes(ULLONG length)