forge
Explore
Log in

Don't you dare go Hollow

pw_utils: Set pts to -1 in spa_meta_header

Browse files at this commit

a30ca7983b2f1fc3ddeb209b3fe18fa78e0dbd25Ivan MolodetskikhParent: 49fc611
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.rsmodified+7 -0
@@ -1434,6 +1434,13 @@ unsafe fn mark_buffer_as_good(pw_buffer: NonNull<pw_buffer>, sequence: &mut u64)
14341434 // Clear the corrupted flag we may have set before.
14351435 (*header).flags = 0;
14361436 (*header).seq = *sequence;
1437+
1438+ // Set buffer timestamp as unknown.
1439+ //
1440+ // FIXME: we could try passing real presentation timestamps for rendered frames here.
1441+ // However, then we must also ensure that the time base never jumps (e.g. when switching a
1442+ // dynamic cast between outputs) as this would mess up the timing downstream.
1443+ (*header).pts = -1;
14371444 }
14381445 }
14391446