summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorRodeo <[email protected]>2015-05-03 22:03:42 +0000
committerRodeo <[email protected]>2015-05-03 22:03:42 +0000
commit5d8aa2e76bfda32b1e6fa404fda95f36231a2b24 (patch)
tree0a93382a1e3d5680f08ca705faf1d70ad8eaa32d /macosx
parent13ed7f1f2160bbd871b097e548fd43f71ae8e9b6 (diff)
MacGui: fix a couple nasty rounding errors.
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
Diffstat (limited to 'macosx')
-rw-r--r--macosx/HBRange.m2
-rw-r--r--macosx/HBTitle.m2
2 files changed, 2 insertions, 2 deletions
diff --git a/macosx/HBRange.m b/macosx/HBRange.m
index b49d5b447..d4e785b30 100644
--- a/macosx/HBRange.m
+++ b/macosx/HBRange.m
@@ -88,7 +88,7 @@ NSString *HBRangeChangedNotification = @"HBRangeChangedNotification";
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];
}
diff --git a/macosx/HBTitle.m b/macosx/HBTitle.m
index be5158327..f2e5b4fb3 100644
--- a/macosx/HBTitle.m
+++ b/macosx/HBTitle.m
@@ -114,7 +114,7 @@ extern NSString *keySubTrackSrtCharCode;
- (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