diff options
author | Peter Schlaile <peter@schlaile.de> | 2007-10-21 19:42:08 +0400 |
---|---|---|
committer | Peter Schlaile <peter@schlaile.de> | 2007-10-21 19:42:08 +0400 |
commit | a0390e5cc340febece6e2a7e61085033d79742e2 (patch) | |
tree | 5d0e89c54603641f394b95b0e76ee917d15a727d /source/blender/src/edittime.c | |
parent | bacfc9eb91f10871a2ba9c3b35e48c3895dffac3 (diff) |
== Core ==
This adds fractional FPS support to blender and should finally
make NTSC work correctly.
NTSC has an FPS of 30.0/1.001 which is approximately 29.97 FPS.
Therefore, it is not enough to simply make frs_sec a float, since
you can't represent this accurately enough.
I added a seperate variable frs_sec_base and FPS is now
frs_sec / frs_sec_base.
I changed all the places, where frs_sec was used to my best knowledge.
For convenience sake, I added several macros, that should make life
easier in the future:
FRA2TIME(a) : convert frame number to a double precision time in seconds
TIME2FRA(a) : the same in the opposite direction
FPS : return current FPS as a double precision number
(last resort)
This closes bug #6715
Standard framerates not supported / breaks sync -- 23.967 29.967 etc.
https://projects.blender.org/tracker/?func=detail&aid=6715&group_id=9&atid=125
Please give this heavy testing with NTSC files, quicktime in/export
and the python interface.
Errors are most probably only spotted on longer timelines, so that is
also important.
The patch was tested by Troy Sobotka and me, so it most probably should
work out of the box, but wider testing is important, since errors are
very subtle.
Enjoy!
Diffstat (limited to 'source/blender/src/edittime.c')
-rw-r--r-- | source/blender/src/edittime.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/src/edittime.c b/source/blender/src/edittime.c index 280c69e2719..f90fd1c2eda 100644 --- a/source/blender/src/edittime.c +++ b/source/blender/src/edittime.c @@ -208,7 +208,7 @@ void transform_markers(int mode, int smode) // mode and smode unused here, for c fac= (((float)(mval[0] - pmval[0]))*dx); if (ELEM(slink->spacetype, SPACE_TIME, SPACE_SOUND)) - apply_keyb_grid(&fac, 0.0, (float)G.scene->r.frs_sec, 0.1*(float)G.scene->r.frs_sec, 0); + apply_keyb_grid(&fac, 0.0, FPS, 0.1*FPS, 0); else apply_keyb_grid(&fac, 0.0, 1.0, 0.1, U.flag & USER_AUTOGRABGRID); offs= (int)fac; @@ -225,11 +225,11 @@ void transform_markers(int mode, int smode) // mode and smode unused here, for c if (stime->flag & TIME_DRAWFRAMES) sprintf(str, "Marker %d offset %d", selmarker->frame, offs); else - sprintf(str, "Marker %.2f offset %.2f", (selmarker->frame/(float)G.scene->r.frs_sec), (offs/(float)G.scene->r.frs_sec)); + sprintf(str, "Marker %.2f offset %.2f", FRA2TIME(selmarker->frame), FRA2TIME(offs)); } else if (slink->spacetype == SPACE_ACTION) { if (saction->flag & SACTION_DRAWTIME) - sprintf(str, "Marker %.2f offset %.2f", (selmarker->frame/(float)G.scene->r.frs_sec), (offs/(float)G.scene->r.frs_sec)); + sprintf(str, "Marker %.2f offset %.2f", FRA2TIME(selmarker->frame), FRA2TIME(offs)); else sprintf(str, "Marker %.2f offset %.2f", (double)(selmarker->frame), (double)(offs)); } @@ -242,11 +242,11 @@ void transform_markers(int mode, int smode) // mode and smode unused here, for c if (stime->flag & TIME_DRAWFRAMES) sprintf(str, "Marker offset %d ", offs); else - sprintf(str, "Marker offset %.2f ", (offs/(float)G.scene->r.frs_sec)); + sprintf(str, "Marker offset %.2f ", FRA2TIME(offs)); } else if (slink->spacetype == SPACE_ACTION) { if (saction->flag & SACTION_DRAWTIME) - sprintf(str, "Marker offset %.2f ", (offs/(float)G.scene->r.frs_sec)); + sprintf(str, "Marker offset %.2f ", FRA2TIME(offs)); else sprintf(str, "Marker offset %.2f ", (double)(offs)); } |