[mythtv-commits] Ticket #4388: mytharchivehelper problem with getfileinfo and method 0

MythTV mythtv at cvs.mythtv.org
Sat Dec 29 16:12:23 UTC 2007


#4388: mytharchivehelper problem with getfileinfo and method 0
----------------------------------------+-----------------------------------
 Reporter:  michele.sardo at katamail.com  |       Owner:  ijr    
     Type:  defect                      |      Status:  new    
 Priority:  minor                       |   Milestone:  unknown
Component:  mythtv                      |     Version:  0.20.2 
 Severity:  low                         |     Mlocked:  0      
----------------------------------------+-----------------------------------
 mytharchivehelper in version 0.20.2 makes an approximation due to a
 misplaced cast in the function getFileInfo.
 In particular on main.cpp line 1951, the original code:
 {{{
 root.setAttribute("duration", (uint) inputFC->duration / AV_TIME_BASE);
 }}}
 should be replaced by:
 {{{
 root.setAttribute("duration", (uint) (inputFC->duration / AV_TIME_BASE));
 }}}

 since casting has precedence over division and so the calculation is wrong
 in some cases, because inputFC->duration can easily exceed 2^32^-1 since
 it is expressed in microseconds.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/4388>
MythTV <http://svn.mythtv.org/trac>
MythTV


More information about the mythtv-commits mailing list