From a30ca7983b2f1fc3ddeb209b3fe18fa78e0dbd25 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sun, 5 Jul 2026 10:50:24 +0300 Subject: [PATCH] pw_utils: Set pts to -1 in spa_meta_header Fixes playback when using GStreamer, since pts = 0 were interpreted as "all buffers are at the same timestamp = 0". (pipewiresrc still won't work as-is in most cases as it doesn't support multi-tile DMA-BUF formats yet) --- src/screencasting/pw_utils.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/screencasting/pw_utils.rs b/src/screencasting/pw_utils.rs index ba10be3e..cd6908dd 100644 --- a/src/screencasting/pw_utils.rs +++ b/src/screencasting/pw_utils.rs @@ -1434,6 +1434,13 @@ unsafe fn mark_buffer_as_good(pw_buffer: NonNull, sequence: &mut u64) // Clear the corrupted flag we may have set before. (*header).flags = 0; (*header).seq = *sequence; + + // Set buffer timestamp as unknown. + // + // FIXME: we could try passing real presentation timestamps for rendered frames here. + // However, then we must also ensure that the time base never jumps (e.g. when switching a + // dynamic cast between outputs) as this would mess up the timing downstream. + (*header).pts = -1; } }