diff options
| author | 2024-12-07 23:47:36 -0500 | |
|---|---|---|
| committer | 2024-12-07 23:47:36 -0500 | |
| commit | d81c406f62e996840d86333b81c41d0ae4aff347 (patch) | |
| tree | 9e6baf260ec56d14e8931b61936b0d043cb49847 /src/buffer | |
| parent | d4da3d8a644156b9f24b560eba58a87b912c1fef (diff) | |
| download | camu-d81c406f62e996840d86333b81c41d0ae4aff347.tar.gz camu-d81c406f62e996840d86333b81c41d0ae4aff347.tar.bz2 camu-d81c406f62e996840d86333b81c41d0ae4aff347.zip | |
Synced list reference 1
This marks a point where the list behavior is at least moderately robust
for the skip operation. It includes fixes for multiple deep-rooted
issues found by testing with input simulation.
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/buffer')
| -rw-r--r-- | src/buffer/clock.c | 5 | ||||
| -rw-r--r-- | src/buffer/clock.h | 1 | ||||
| -rw-r--r-- | src/buffer/video.c | 5 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/buffer/clock.c b/src/buffer/clock.c index e1813f7..705a525 100644 --- a/src/buffer/clock.c +++ b/src/buffer/clock.c @@ -69,6 +69,11 @@ void camu_clock_resume(struct camu_clock *clock, u64 target) clock->paused_at = -1.0; } +bool camu_clock_is_armed(struct camu_clock *clock) +{ + return al_atomic_load(f64)(&clock->pause, AL_ATOMIC_RELAXED) != RUNNING; +} + bool camu_clock_is_paused(struct camu_clock *clock) { return al_atomic_load(f64)(&clock->pause, AL_ATOMIC_RELAXED) == PAUSED; diff --git a/src/buffer/clock.h b/src/buffer/clock.h index 64f4ddb..aae87cc 100644 --- a/src/buffer/clock.h +++ b/src/buffer/clock.h @@ -43,6 +43,7 @@ void camu_clock_offset(struct camu_clock *clock, f64 amount); void camu_clock_pause(struct camu_clock *clock, u64 ts); void camu_clock_resume(struct camu_clock *clock, u64 ts); +bool camu_clock_is_armed(struct camu_clock *clock); bool camu_clock_is_paused(struct camu_clock *clock); f64 camu_clock_get_base_pts(struct camu_clock *clock); diff --git a/src/buffer/video.c b/src/buffer/video.c index ba43685..2879082 100644 --- a/src/buffer/video.c +++ b/src/buffer/video.c @@ -20,8 +20,9 @@ bool camu_video_buffer_init(struct camu_video_buffer *buf, struct camu_clock *cl buf->clock = clock; buf->latency = 0.0; al_atomic_store(f64)(&buf->pts, -1.0, AL_ATOMIC_RELAXED); - // Defaulting single_frame to true can simplify non-configured buffers in sink. - buf->single_frame = true; + // The least confusing behavior for single_frame is that it can't be + // set unless the buffer is not empty. + buf->single_frame = false; buf->avg_frame_duration = 0.0; buf->queue = NULL; buf->buffered = false; |