diff options
Diffstat (limited to 'libs/pbd')
-rw-r--r-- | libs/pbd/pbd/playback_buffer.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/pbd/pbd/playback_buffer.h b/libs/pbd/pbd/playback_buffer.h index 4b0b900217..75a30bc86f 100644 --- a/libs/pbd/pbd/playback_buffer.h +++ b/libs/pbd/pbd/playback_buffer.h @@ -65,10 +65,20 @@ public: /* writer, when seeking, may block */ Glib::Threads::Mutex::Lock lm (_reset_lock); SpinLock sl (_reservation_lock); - g_atomic_int_set (&write_idx, g_atomic_int_get (&read_idx)); + g_atomic_int_set (&read_idx, 0); + g_atomic_int_set (&write_idx, 0); g_atomic_int_set (&reserved, 0); } + /* called from rt (reader) thread for new buffers */ + void align_to (PlaybackBuffer const& other) { + Glib::Threads::Mutex::Lock lm (_reset_lock); + write_idx = other.write_idx; + read_idx = other.read_idx; + reserved = other.reserved; + memset (buf, 0, size * sizeof (T)); + } + /* write-thread */ guint write_space () const { guint w, r; |