Use QByteArray::reserve() rather than reallocating each time we must resize
This commit is contained in:
parent
99d9de35de
commit
18d1d35104
1 changed files with 3 additions and 3 deletions
|
|
@ -620,9 +620,9 @@ int FFmpegVideoDecoder::submitDecodeUnit(PDECODE_UNIT du)
|
|||
// Add some extra space in case we need to do an SPS fixup
|
||||
requiredBufferSize += MAX_SPS_EXTRA_SIZE;
|
||||
}
|
||||
if (requiredBufferSize + AV_INPUT_BUFFER_PADDING_SIZE > m_DecodeBuffer.length()) {
|
||||
m_DecodeBuffer = QByteArray(requiredBufferSize + AV_INPUT_BUFFER_PADDING_SIZE, 0);
|
||||
}
|
||||
|
||||
// Ensure the decoder buffer is large enough
|
||||
m_DecodeBuffer.reserve(requiredBufferSize + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
|
||||
int offset = 0;
|
||||
while (entry != nullptr) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue