From 2bbf92ad5ae7708bf18ac7ef333e9a979d8d1bde Mon Sep 17 00:00:00 2001 From: Uneven Prankster Date: Thu, 16 Nov 2023 21:12:27 -0300 Subject: Working so hard like a soldier Can't afford a thing on TV --- raylib/src/external/qoaplay.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'raylib/src/external/qoaplay.c') diff --git a/raylib/src/external/qoaplay.c b/raylib/src/external/qoaplay.c index 7f937f4..cc4d8c6 100644 --- a/raylib/src/external/qoaplay.c +++ b/raylib/src/external/qoaplay.c @@ -36,7 +36,7 @@ // QOA streaming data descriptor typedef struct { qoa_desc info; // QOA descriptor data - + FILE *file; // QOA file to read, if NULL, using memory buffer -> file_data unsigned char *file_data; // QOA file data on memory unsigned int file_data_size; // QOA file data on memory size @@ -68,7 +68,7 @@ void qoaplay_close(qoaplay_desc *qoa_ctx); void qoaplay_rewind(qoaplay_desc *qoa_ctx); void qoaplay_seek_frame(qoaplay_desc *qoa_ctx, int frame); -unsigned int qoaplay_decode(qoaplay_desc *qoa_ctx, float *sample_data, int num_samples); +unsigned int qoaplay_decode(qoaplay_desc *qoa_ctx, float *sample_data, int num_samples, int loop_point); unsigned int qoaplay_decode_frame(qoaplay_desc *qoa_ctx); double qoaplay_get_duration(qoaplay_desc *qoa_ctx); double qoaplay_get_time(qoaplay_desc *qoa_ctx); @@ -107,7 +107,7 @@ qoaplay_desc *qoaplay_open(const char *path) unsigned int sample_data_size = qoa.channels*QOA_FRAME_LEN*sizeof(short)*2; qoaplay_desc *qoa_ctx = QOA_MALLOC(sizeof(qoaplay_desc) + buffer_size + sample_data_size); memset(qoa_ctx, 0, sizeof(qoaplay_desc)); - + qoa_ctx->file = file; qoa_ctx->file_data = NULL; qoa_ctx->file_data_size = 0; @@ -209,7 +209,7 @@ void qoaplay_rewind(qoaplay_desc *qoa_ctx) } // Decode required QOA frames -unsigned int qoaplay_decode(qoaplay_desc *qoa_ctx, float *sample_data, int num_samples) +unsigned int qoaplay_decode(qoaplay_desc *qoa_ctx, float *sample_data, int num_samples, int loop_point) { int src_index = qoa_ctx->sample_data_pos*qoa_ctx->info.channels; int dst_index = 0; @@ -222,7 +222,8 @@ unsigned int qoaplay_decode(qoaplay_desc *qoa_ctx, float *sample_data, int num_s if (!qoaplay_decode_frame(qoa_ctx)) { // Loop to the beginning - qoaplay_rewind(qoa_ctx); + //qoaplay_rewind(qoa_ctx); + qoaplay_seek_frame(qoa_ctx, loop_point); qoaplay_decode_frame(qoa_ctx); } -- cgit v1.2.3