summaryrefslogtreecommitdiff
path: root/src/libsink
diff options
context:
space:
mode:
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: {