Сохранять выдачу старого GPU до первого IDR замены
This commit is contained in:
1 parent
ae8eeab490
commit
2facdb6949
3 files changed
+13
-1
No files matched your search
@@ -121,6 +121,14 @@ bool CallVideoEncoder::encode(const QImage& image, uint64_t pts, bool forceKey,
|
||||
(unsigned long long)m_request, m_switchInputs, (long long)frames.size(), qPrintable(m_replacement->error()));
|
||||
completion = {m_format.generation, m_request, 0}; m_request = 0; m_pendingBitrate = 0;
|
||||
m_replacement.reset(); frames.clear(); key = true; m_keyPending = false;
|
||||
} else if (m_replacement && frames.isEmpty()) {
|
||||
// До первого нового IDR продолжаем выдавать только старые кадры с PTS раньше границы замены.
|
||||
// Уже выданный PTS не может обогнать ожидаемый IDR и сделать его устаревшим.
|
||||
QList<LiveEncodedFrame> previous;
|
||||
if (m_encoder->encode(image, pts, false, previous)) {
|
||||
for (auto& frame : previous) if (frame.pts < m_switchPts) frames.push_back(std::move(frame));
|
||||
} else DEBUG_WARN(DEBUG_CATEGORY_CALL, "old GPU failed while replacement is pending request=%llu: %s",
|
||||
(unsigned long long)m_request, qPrintable(m_encoder->error()));
|
||||
}
|
||||
}
|
||||
if (!encoded) encoded = m_encoder->encode(image, pts, key, frames);
|
||||
|
||||
Reference in new issue
Block a user