diff options
| author | 2024-01-07 17:58:16 -0500 | |
|---|---|---|
| committer | 2024-01-07 17:58:16 -0500 | |
| commit | 342e613fba5849c11a07d568f765f512f30ea6cf (patch) | |
| tree | 78d361a24cb2df7c6bfd4c4fd087a487df245ffd /src/util | |
| parent | e6c1c0afc69ee13465bb68a6bdeb35b6876146d4 (diff) | |
| download | camu-342e613fba5849c11a07d568f765f512f30ea6cf.tar.gz camu-342e613fba5849c11a07d568f765f512f30ea6cf.tar.bz2 camu-342e613fba5849c11a07d568f765f512f30ea6cf.zip | |
Rough seek implementation
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/blocking_ring_buffer.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/util/blocking_ring_buffer.c b/src/util/blocking_ring_buffer.c index 2160fec..5cc3325 100644 --- a/src/util/blocking_ring_buffer.c +++ b/src/util/blocking_ring_buffer.c @@ -89,9 +89,7 @@ u8 *camu_ring_buffer_get_chunk(struct camu_ring_buffer *buffer, s32 n) { aki_mutex_lock(&buffer->mutex); - if (!buffer->enabled) { - return NULL; - } + if (!buffer->enabled) return NULL; if (buffer->end < buffer->start) { if (buffer->end + n > buffer->size) { @@ -145,9 +143,7 @@ s32 camu_ring_buffer_read(struct camu_ring_buffer *buffer, u8 **data, s32 n) *data = &buffer->data[buffer->start]; // If start == end, the buffer is empty. - if (buffer->start == buffer->end) { - return 0; - } + if (buffer->start == buffer->end) return 0; if (buffer->end < buffer->start) { // If we would read past the valid data in the buffer, instead @@ -191,9 +187,7 @@ void camu_ring_buffer_unlock(struct camu_ring_buffer *buffer) void camu_ring_buffer_free(struct camu_ring_buffer *buffer) { - if (buffer->data) { - al_free(buffer->data); - } + if (buffer->data) al_free(buffer->data); aki_mutex_destroy(&buffer->mutex); aki_cond_destroy(&buffer->cond); } |