Opened 20 years ago
Closed 20 years ago
#968 closed patch (fixed)
Remove harmful "optimization" from AFD::HandleGopStart
Reported by: | Owned by: | Isaac Richards | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythtv | Version: | head |
Severity: | low | Keywords: | |
Cc: | Ticket locked: | no |
Description
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}; m_positionMap.push_back(entry);
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.
Attachments (1)
Change History (2)
by , 20 years ago
Attachment: | qvaluevector-patch.txt added |
---|
comment:1 by , 20 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
(In [8547]) Close #968 by applying patch (remove bad manual growing of a qvector).