diff options
Diffstat (limited to 'libs/pbd')
-rw-r--r-- | libs/pbd/pbd/playback_buffer.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/pbd/pbd/playback_buffer.h b/libs/pbd/pbd/playback_buffer.h index 75a30bc86f..2926e90be2 100644 --- a/libs/pbd/pbd/playback_buffer.h +++ b/libs/pbd/pbd/playback_buffer.h @@ -122,6 +122,18 @@ public: } } + /* write thread */ + guint overwritable_at (guint r) const { + guint w; + + w = g_atomic_int_get (&write_idx); + + if (w > r) { + return w - r; + } + return (w - r + size) & size_mask; + } + /* read-thead */ guint read (T *dest, guint cnt, bool commit = true, guint offset = 0); |