[Jahshaka-cvs] openlibraries/src/openmedialib/plugins/gensys gensys_plugin.cpp, 1.20, 1.21
Status: Beta
Brought to you by:
jahshaka
From: Charles Y. <lil...@us...> - 2007-03-07 09:23:47
|
Update of /cvsroot/openlibraries/openlibraries/src/openmedialib/plugins/gensys In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14962 Modified Files: gensys_plugin.cpp Log Message: + Fix for int overflows Index: gensys_plugin.cpp =================================================================== RCS file: /cvsroot/openlibraries/openlibraries/src/openmedialib/plugins/gensys/gensys_plugin.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- gensys_plugin.cpp 3 Mar 2007 10:02:37 -0000 1.20 +++ gensys_plugin.cpp 7 Mar 2007 09:23:43 -0000 1.21 @@ -1330,12 +1330,12 @@ private: inline int map_source_to_dest( int position ) const { - return int( float( position * prop_fps_num_.value< int >( ) * src_fps_den_ ) / ( prop_fps_den_.value< int >( ) * src_fps_num_ ) + 0.5 ); + return int( position * ( double( prop_fps_num_.value< int >( ) * src_fps_den_ ) / double( prop_fps_den_.value< int >( ) * src_fps_num_ ) ) ); } inline int map_dest_to_source( int position ) const { - return int( float( position * src_fps_num_ * prop_fps_den_.value< int >( ) ) / ( src_fps_den_ * prop_fps_num_.value< int >( ) ) + 0.5 ); + return int( position * ( double( src_fps_num_ * prop_fps_den_.value< int >( ) ) / double( src_fps_den_ * prop_fps_num_.value< int >( ) ) ) ); } int position_; |