summaryrefslogtreecommitdiff
path: root/src/buffer
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2026-07-02 17:52:27 -0400
committerAndrew Opalach <andrew@akon.city> 2026-07-02 17:52:27 -0400
commit34933b7e1d682e67702999270cd3ceec0e167316 (patch)
treea6777f793fe658ad0facb85876e41cb66dbec2c2 /src/buffer
parentef3f687db0f53f026e808c4284e084255c9e9dd5 (diff)
downloadcamu-34933b7e1d682e67702999270cd3ceec0e167316.tar.gz
camu-34933b7e1d682e67702999270cd3ceec0e167316.tar.bz2
camu-34933b7e1d682e67702999270cd3ceec0e167316.zip
Update deps, build fixes, cleanup
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/buffer')
-rw-r--r--src/buffer/audio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/buffer/audio.c b/src/buffer/audio.c
index 7c10dda..a815c66 100644
--- a/src/buffer/audio.c
+++ b/src/buffer/audio.c
@@ -145,8 +145,8 @@ static bool push_internal(struct camu_audio_buffer *buf, f64 pts, u8 **data, s32
}
}
- if (base_pts == -1.0) {
- // We want this push() to set the pts even if sample_count = 0.
+ if (base_pts == -1.0) { // This push() has to set buf->pts even if sample_count = 0.
+ al_assert(!buf->buffered);
atomic_store(f64)(&buf->pts, pts, AL_ATOMIC_RELEASE);
}
@@ -478,8 +478,8 @@ ptrdiff_t camu_audio_buffer_read(struct camu_audio_buffer *buf, u8 *data, ptrdif
}
out:
- // We aren't safe to increment buf->pts from a different thread.
- // For that we could accumulate the difference and atomic_add here instead.
+ // Updating buf->pts from the read() thread has to be done in a single step.
+ // atomic_add() at the points where base_pts is incremented would be incorrect.
atomic_store(f64)(&buf->pts, base_pts, AL_ATOMIC_RELEASE);
// To signal EOF, return less then req.