summaryrefslogtreecommitdiff
path: root/src/buffer
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-01-24 18:14:52 -0500
committerAndrew Opalach <andrew@akon.city> 2025-01-24 18:14:52 -0500
commitf638237a6b4f3d3edf9bdd995c15df537f8d7e7c (patch)
tree44efce6d912c43f67548690256879d036e22e742 /src/buffer
parent2daa31c0629f2eb4af84d6f4fed8ac89813de056 (diff)
downloadcamu-f638237a6b4f3d3edf9bdd995c15df537f8d7e7c.tar.gz
camu-f638237a6b4f3d3edf9bdd995c15df537f8d7e7c.tar.bz2
camu-f638237a6b4f3d3edf9bdd995c15df537f8d7e7c.zip
Fix multiple bugs encountered during stress test
- Basic server resource cleanup Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/buffer')
-rw-r--r--src/buffer/audio.c6
-rw-r--r--src/buffer/video.c3
2 files changed, 4 insertions, 5 deletions
diff --git a/src/buffer/audio.c b/src/buffer/audio.c
index cf42840..ce027af 100644
--- a/src/buffer/audio.c
+++ b/src/buffer/audio.c
@@ -11,7 +11,7 @@
#define BUFFER_SIZE 8.0
#define BUFFER_MARK_MIN 3.25 // Must be a most half of the buffer size.
-#define BUFFER_MARK_BUFFERED 1.25
+#define BUFFER_MARK_BUFFERED 1.0
#ifdef CAMU_AUDIO_BUFFER_FADE
#define FADE_STEP(fmt) (1.75f / (fmt)->sample_rate)
@@ -408,8 +408,8 @@ ptrdiff_t camu_audio_buffer_read(struct camu_audio_buffer *buf, u8 *data, ptrdif
if (step != 0.f || buf->fade.volume != 1.f) {
if (buf->volume.user > 1.f) {
- // Only adjust the step if it's an increase to avoid
- // drawn-out fades if the volume is low.
+ // Only adjust the step if it's an increase to avoid drawn-out
+ // fades if the volume is low.
step *= buf->volume.user;
}
buf->fade.volume = apply_volume(data, req, fmt, buf->fade.volume, buf->volume.user, step);
diff --git a/src/buffer/video.c b/src/buffer/video.c
index bb217af..7771939 100644
--- a/src/buffer/video.c
+++ b/src/buffer/video.c
@@ -17,13 +17,12 @@
bool camu_video_buffer_init(struct camu_video_buffer *buf, struct camu_clock *clock)
{
-
buf->clock = clock;
buf->latency = 0.0;
al_atomic_store(f64)(&buf->pts, -1.0, AL_ATOMIC_RELAXED);
buf->last_pts = -1.0;
// The least confusing behavior for single_frame is that it can't be
- // set unless the buffer is not empty.
+ // set if the buffer is empty.
buf->single_frame = false;
buf->avg_frame_duration = 0.0;
buf->queue = NULL;