From 626f299dd3512d44df4bcf95fc7a21b9417c06b0 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Tue, 22 Oct 2024 18:11:37 -0400 Subject: Various fixes, doc cleanup Signed-off-by: Andrew Opalach --- src/buffer/clock.c | 1 - src/buffer/video.c | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/buffer') diff --git a/src/buffer/clock.c b/src/buffer/clock.c index c4a07a6..a04bb08 100644 --- a/src/buffer/clock.c +++ b/src/buffer/clock.c @@ -59,7 +59,6 @@ void camu_clock_resume(struct camu_clock *clock, u64 target) //} else if (target > 0) { if (target > 0) { tick = calc_tick_offset(tick, aki_get_timestamp(), target); - al_printf("%f\n", tick); } if (clock->paused_at == 0.0) { if (target == 0) { diff --git a/src/buffer/video.c b/src/buffer/video.c index b2381b2..a7a5594 100644 --- a/src/buffer/video.c +++ b/src/buffer/video.c @@ -149,6 +149,7 @@ void camu_video_buffer_push(struct camu_video_buffer *buf, struct camu_codec_fra // Not thread-safe, must be called while the buffer is not being read from or written to. void camu_video_buffer_reset(struct camu_video_buffer *buf) { + buf->pts = -1.0; buf->queue->reset(buf->queue); buf->buffered = false; al_atomic_store(u8)(&buf->flow, FLOWING, AL_ATOMIC_RELAXED); @@ -172,7 +173,7 @@ bool camu_video_buffer_read(struct camu_video_buffer *buf, void *out) f64 pts = camu_clock_get_pts(buf->clock, buf->latency); if (pts > buf->pts) buf->pts = pts; } - u8 flow = al_atomic_load(u8)(&buf->flow, AL_ATOMIC_RELAXED); + u8 flow = al_atomic_load(u8)(&buf->flow, AL_ATOMIC_ACQUIRE); if (flow == SIGNALED && !buf->single_frame) { buf->callback(buf->userdata, CAMU_BUFFER_EOF); return false; @@ -180,7 +181,7 @@ bool camu_video_buffer_read(struct camu_video_buffer *buf, void *out) u8 ret = buf->queue->read(buf->queue, buf->pts, out); if (flow == FLUSHED && (ret == CAMU_QUEUE_EOF || (buf->single_frame && ret == CAMU_QUEUE_OK))) { buf->callback(buf->userdata, CAMU_BUFFER_EOF); - al_atomic_store(u8)(&buf->flow, SIGNALED, AL_ATOMIC_RELAXED); + al_atomic_store(u8)(&buf->flow, SIGNALED, AL_ATOMIC_RELEASE); al_log_debug("video_buffer", "Flushed."); } else if (flow == FLOWING && buf->queue->count(buf->queue) <= BUFFER_WATERMARK_LOW) { buf->callback(buf->userdata, CAMU_BUFFER_UNCORK); -- cgit v1.2.3-101-g0448