The results could be off by almost 4% with 30fps sources.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7154
b64f7644-9d1e-0410-96f1-
a4d463321fa5
else if (self.type == HBRangeTypeFrames)
{
hb_title_t *title = self.title.hb_title;
- int duration = (self.frameStop - self.frameStart) / (title->vrate.num / title->vrate.den);
+ int duration = (self.frameStop - self.frameStart) / (title->vrate.num / (double)title->vrate.den);
return [NSString stringWithFormat: @"%02d:%02d:%02d", duration / 3600, ( duration / 60 ) % 60, duration % 60];
}
- (int)frames
{
- return self.duration * (self.hb_title->vrate.num / self.hb_title->vrate.den);
+ return (self.hb_title->duration / 90000.) * (self.hb_title->vrate.num / (double)self.hb_title->vrate.den);
}
- (NSString *)timeCode