Made SetVideo discard keyframe data if every frame in the video is a keyframe. Fixes #547.

Originally committed to SVN as r1699.
This commit is contained in:
Karl Blomster 2008-01-13 20:25:47 +00:00
parent acc26dba67
commit 58b1637bd8
2 changed files with 17 additions and 0 deletions

View file

@ -30,6 +30,7 @@ Please visit http://aegisub.net to download latest version
o CSRI support for subtitles on all platforms. (equinox/AMZ) o CSRI support for subtitles on all platforms. (equinox/AMZ)
o Framegrabs from the video now also includes framenumber in the filename. (jfs) o Framegrabs from the video now also includes framenumber in the filename. (jfs)
o Added a toggleable overscan mask to show which areas might get cropped by televisions. (AMZ) o Added a toggleable overscan mask to show which areas might get cropped by televisions. (AMZ)
o Keyframe data will no longer be loaded for video files which are all keyframes (i.e. most lossless AVI files) since it was meaningless. (TheFluff)
- Visual Typesetting functionality implemented, which should make typesetting much easier and faster. It supports: (AMZ) - Visual Typesetting functionality implemented, which should make typesetting much easier and faster. It supports: (AMZ)
o Dragging, including support for \move; o Dragging, including support for \move;
o Rotation on Z axis; o Rotation on Z axis;

View file

@ -297,7 +297,23 @@ void VideoContext::SetVideo(const wxString &filename) {
#endif #endif
keyFramesLoaded = true; keyFramesLoaded = true;
} }
// Check if the file is all keyframes
bool isAllKeyFrames = true;
for (unsigned int i=1; i<KeyFrames.GetCount(); i++) {
// Is the last keyframe not this keyframe -1?
if (KeyFrames[i-1] != (i-1)) {
// It's not all keyframes, go ahead
isAllKeyFrames = false;
break;
}
}
// If it is all keyframes, discard the keyframe info as it is useless
if (isAllKeyFrames) {
KeyFrames.Clear();
keyFramesLoaded = false;
}
// Set GL context // Set GL context
#ifdef __WXMAC__ #ifdef __WXMAC__