From 76fc9fe33dd58926e552b6bd3b79d798b452c6ed Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Thu, 17 Apr 2025 21:31:24 -0400 Subject: Fix user volume fade and relative seek below 0 - Fix sync issue in sink. - Update deps and android build. Signed-off-by: Andrew Opalach --- src/libsink/sink.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/libsink') diff --git a/src/libsink/sink.c b/src/libsink/sink.c index fe87df5..2b9d585 100644 --- a/src/libsink/sink.c +++ b/src/libsink/sink.c @@ -469,10 +469,14 @@ static void mixer_callback(void *userdata, u8 op) if (op == CAMU_MIXER_EMPTY) { log_info("Mixer empty."); #ifndef LIANA_LIST_SCUFFED_LOOP + // We need to sync with do_add_entry() because the order of + // the START/STOP's in the queue matters. + nn_mutex_lock(&sink->lock); queue_cmd(sink, (struct camu_sink_cmd){ .op = STOP, .value.i = CAMU_SINK_AUDIO }); + nn_mutex_unlock(&sink->lock); #else (void)sink; #endif @@ -1643,7 +1647,8 @@ void camu_sink_seek(struct camu_sink *sink, void *value, u8 mode) } case CAMU_SEEK_RELATIVE: { f64 offset = *(f64 *)value; - cmd.value.u = (u64)((pts + offset) * 1000000); + pts = MAX(pts + offset, 0.0); + cmd.value.u = (u64)(pts * 1000000); break; } case CAMU_SEEK_PERCENT: { -- cgit v1.2.3-101-g0448