plugins/screencast: Provide absolute timestamps
Pipewire's buffer meta structure apparently wants the presentation timestamp to be absolute (where absolute means number of nanoseconds since computer was started). So subtracting the timestamp of the buffer breaks the timestamps later on in the pipeline.
This commit is contained in:
parent
9e3999dc5f
commit
d86da339d1
2 changed files with 1 additions and 7 deletions
|
@ -582,12 +582,7 @@ void ScreenCastStream::addHeader(spa_buffer *spaBuffer)
|
|||
spaHeader->flags = 0;
|
||||
spaHeader->dts_offset = 0;
|
||||
spaHeader->seq = m_sequential++;
|
||||
|
||||
const auto timestamp = m_source->clock();
|
||||
if (!m_start) {
|
||||
m_start = timestamp;
|
||||
}
|
||||
spaHeader->pts = (timestamp - m_start.value()).count();
|
||||
spaHeader->pts = m_source->clock().count();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -128,7 +128,6 @@ private:
|
|||
pw_buffer *m_pendingBuffer = nullptr;
|
||||
std::unique_ptr<QSocketNotifier> m_pendingNotifier;
|
||||
std::unique_ptr<EGLNativeFence> m_pendingFence;
|
||||
std::optional<std::chrono::nanoseconds> m_start;
|
||||
quint64 m_sequential = 0;
|
||||
bool m_hasDmaBuf = false;
|
||||
bool m_waitForNewBuffers = false;
|
||||
|
|
Loading…
Reference in a new issue