[mythtv-commits] Ticket #968: Remove harmful "optimization" from AFD::HandleGopStart

MythTV mythtv at cvs.mythtv.org
Sun Jan 8 22:44:04 UTC 2006

#968: Remove harmful "optimization" from AFD::HandleGopStart
 Reporter:  bolek-mythtv at curl.com (Boleslaw Ciesielski)  |       Owner:  ijr 
     Type:  patch                                        |      Status:  new 
 Priority:  minor                                        |   Milestone:      
Component:  mythtv                                       |     Version:  head
 Severity:  low                                          |  
 The following code in AvFormatDecoder::HandleGopStart:

             // Grow positionMap vector several entries at a time
             if (m_positionMap.capacity() == m_positionMap.size())
                 m_positionMap.reserve(m_positionMap.size() + 60);
             PosMapEntry entry = {prevgoppos / keyframedist,
                                  prevgoppos, startpos};

 forces the position map to grow by 60 elements whenever it is full. This
 is not only not neccessary since QValueVector does the right thing
 already, but it is actually harmful since it introduces quadratic
 behavior. QValueVector by itself uses the exponential growth algorithm
 which preserves the linear behavior.

 A patch that removes this code is attached.

Ticket URL: <http://svn.mythtv.org/trac/ticket/968>
MythTV <http://www.mythtv.org/>

More information about the mythtv-commits mailing list