summaryrefslogtreecommitdiff
path: root/src/audio/ring_buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio/ring_buffer.h')
-rw-r--r--src/audio/ring_buffer.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/audio/ring_buffer.h b/src/audio/ring_buffer.h
index b19c1ea..80b375f 100644
--- a/src/audio/ring_buffer.h
+++ b/src/audio/ring_buffer.h
@@ -42,6 +42,11 @@ class AudioRingBuffer {
return total_read_.load(std::memory_order_acquire);
}
+ // Get total samples written (for render timing)
+ int64_t get_total_written() const {
+ return total_written_.load(std::memory_order_acquire);
+ }
+
// Clear buffer (for seeking)
void clear();
@@ -52,4 +57,6 @@ class AudioRingBuffer {
std::atomic<int> write_pos_; // Write position (0 to capacity-1)
std::atomic<int> read_pos_; // Read position (0 to capacity-1)
std::atomic<int64_t> total_read_; // Total samples read (for playback time)
+ std::atomic<int64_t>
+ total_written_; // Total samples written (for render timing)
};