diff options
Diffstat (limited to 'src/buffer')
| -rw-r--r-- | src/buffer/clock.c | 1 | ||||
| -rw-r--r-- | src/buffer/video.c | 5 |
2 files changed, 3 insertions, 3 deletions
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); |