summaryrefslogtreecommitdiff
path: root/src/libsink
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-04-17 21:31:24 -0400
committerAndrew Opalach <andrew@akon.city> 2025-04-17 21:33:08 -0400
commit76fc9fe33dd58926e552b6bd3b79d798b452c6ed (patch)
treebdbffbb532fb0da1195e34119b3f5ecb1cc200d7 /src/libsink
parentde68f3f60442edc5138fdb5320f40ec53a35b232 (diff)
downloadcamu-76fc9fe33dd58926e552b6bd3b79d798b452c6ed.tar.gz
camu-76fc9fe33dd58926e552b6bd3b79d798b452c6ed.tar.bz2
camu-76fc9fe33dd58926e552b6bd3b79d798b452c6ed.zip
Fix user volume fade and relative seek below 0
- Fix sync issue in sink. - Update deps and android build. Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/libsink')
-rw-r--r--src/libsink/sink.c7
1 files changed, 6 insertions, 1 deletions
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: {