From f83c79e72945c0a09da9686e66e1b9d7dad6b3fd Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 24 Jul 2025 14:46:37 +0800 Subject: [PATCH] synchronize code Signed-off-by: Robin --- src/modules/module-suspend-on-idle.c | 1 - src/pulse/thread-mainloop.c | 8 ++++---- src/pulsecore/asyncmsgq.c | 2 +- src/pulsecore/modargs.c | 1 + src/pulsecore/remap.c | 2 +- src/pulsecore/sink-input.c | 5 ++--- src/pulsecore/sink.c | 2 +- src/pulsecore/source-output.c | 1 + 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/modules/module-suspend-on-idle.c b/src/modules/module-suspend-on-idle.c index 7b738f874..340b79529 100644 --- a/src/modules/module-suspend-on-idle.c +++ b/src/modules/module-suspend-on-idle.c @@ -332,7 +332,6 @@ static pa_hook_result_t device_new_hook_cb(pa_core *c, pa_object *o, struct user pa_assert(source || sink); timeout_str = pa_proplist_gets(sink ? sink->proplist : source->proplist, "module-suspend-on-idle.timeout"); - if (timeout_str && pa_atoi(timeout_str, &timeout) >= 0) timeout_valid = true; else diff --git a/src/pulse/thread-mainloop.c b/src/pulse/thread-mainloop.c index 8e794d458..ac150f4ae 100644 --- a/src/pulse/thread-mainloop.c +++ b/src/pulse/thread-mainloop.c @@ -168,7 +168,7 @@ void pa_threaded_mainloop_lock(pa_threaded_mainloop *m) { pa_assert(m); /* Make sure that this function is not called from the helper thread, unless it is unlocked */ - //pa_assert(!m->thread || !pa_thread_is_running(m->thread) || !in_worker(m) || pa_atomic_load(&m->in_once_unlocked)); + pa_assert(!m->thread || !pa_thread_is_running(m->thread) || !in_worker(m) || pa_atomic_load(&m->in_once_unlocked)); pa_mutex_lock(m->mutex); } @@ -177,7 +177,7 @@ void pa_threaded_mainloop_unlock(pa_threaded_mainloop *m) { pa_assert(m); /* Make sure that this function is not called from the helper thread, unless it is unlocked */ - //pa_assert(!m->thread || !pa_thread_is_running(m->thread) || !in_worker(m) || pa_atomic_load(&m->in_once_unlocked)); + pa_assert(!m->thread || !pa_thread_is_running(m->thread) || !in_worker(m) || pa_atomic_load(&m->in_once_unlocked)); pa_mutex_unlock(m->mutex); } @@ -216,9 +216,9 @@ void pa_threaded_mainloop_accept(pa_threaded_mainloop *m) { pa_assert(m); /* Make sure that this function is not called from the helper thread */ - //pa_assert(!m->thread || !pa_thread_is_running(m->thread) || !in_worker(m)); + pa_assert(!m->thread || !pa_thread_is_running(m->thread) || !in_worker(m)); - //pa_assert(m->n_waiting_for_accept > 0); + pa_assert(m->n_waiting_for_accept > 0); m->n_waiting_for_accept --; pa_cond_signal(m->accept_cond, 0); diff --git a/src/pulsecore/asyncmsgq.c b/src/pulsecore/asyncmsgq.c index c176bd0eb..5e5f11213 100644 --- a/src/pulsecore/asyncmsgq.c +++ b/src/pulsecore/asyncmsgq.c @@ -76,7 +76,7 @@ pa_asyncmsgq *pa_asyncmsgq_new(unsigned size) { pa_assert_se(a->mutex = pa_mutex_new(false, true)); a->current = NULL; asyncmsgqNum += 1; - a->mark = asyncmsgqNum; + a->mark = asyncmsgqNum; return a; } diff --git a/src/pulsecore/modargs.c b/src/pulsecore/modargs.c index 73ae66311..cda2bbc84 100644 --- a/src/pulsecore/modargs.c +++ b/src/pulsecore/modargs.c @@ -344,6 +344,7 @@ int pa_modargs_get_value_s32(pa_modargs *ma, const char *key, int32_t *value) { int pa_modargs_get_value_u64(pa_modargs *ma, const char *key, uint64_t *value) { const char *v; + pa_assert(value); if (!(v = pa_modargs_get_value(ma, key, NULL))) { diff --git a/src/pulsecore/remap.c b/src/pulsecore/remap.c index 35fffd7d2..05f9adb06 100644 --- a/src/pulsecore/remap.c +++ b/src/pulsecore/remap.c @@ -282,7 +282,7 @@ static void remap_channels_matrix_s16ne_c(pa_remap_t *m, int16_t *dst, const int *d += *s; } else { for (i = n; i > 0; i--, s += n_ic, d += n_oc) - *d += (int16_t) (((int32_t)*s * vol) >> 16); + *d += (int16_t) ((((int32_t)*s * vol) >> 16) * 0.99); } } } diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c index da0798a3f..c562f2222 100644 --- a/src/pulsecore/sink-input.c +++ b/src/pulsecore/sink-input.c @@ -1562,7 +1562,7 @@ bool pa_sink_input_is_passthrough(pa_sink_input *i) { /* Called from main context */ bool pa_sink_input_is_volume_readable(pa_sink_input *i) { pa_sink_input_assert_ref(i); - // pa_assert_ctl_context(); + pa_assert_ctl_context(); return !pa_sink_input_is_passthrough(i); } @@ -1570,7 +1570,6 @@ bool pa_sink_input_is_volume_readable(pa_sink_input *i) { /* Called from main context */ pa_cvolume *pa_sink_input_get_volume(pa_sink_input *i, pa_cvolume *volume, bool absolute) { pa_sink_input_assert_ref(i); - // pa_assert_ctl_context(); pa_assert(PA_SINK_INPUT_IS_LINKED(i->state)); pa_assert(pa_sink_input_is_volume_readable(i)); @@ -2561,7 +2560,7 @@ void pa_sink_input_send_event(pa_sink_input *i, const char *event, pa_proplist * pa_sink_input_send_event_hook_data hook_data; pa_sink_input_assert_ref(i); - // pa_assert_ctl_context(); + pa_assert_ctl_context(); pa_assert(event); if (!i->send_event) diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c index 90ad1a75e..b355e3dcc 100644 --- a/src/pulsecore/sink.c +++ b/src/pulsecore/sink.c @@ -3367,7 +3367,7 @@ void pa_sink_set_fixed_latency(pa_sink *s, pa_usec_t latency) { pa_assert_ctl_context(); if (s->flags & PA_SINK_DYNAMIC_LATENCY) { - //pa_assert(latency == 0); + pa_assert(latency == 0); return; } diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c index 7055137cf..dc86ac5ea 100644 --- a/src/pulsecore/source-output.c +++ b/src/pulsecore/source-output.c @@ -1299,6 +1299,7 @@ bool pa_source_output_may_move(pa_source_output *o) { pa_log_info("Refused move to new default source!"); return false; } + if (o->direct_on_input) return false; -- Gitee