From da1a9746d483ef265e1bd8f9d52bb978faaf6597 Mon Sep 17 00:00:00 2001 From: Maninblack Date: Fri, 30 May 2025 17:01:16 +0800 Subject: [PATCH 1/2] clear delay_memblockq and reset resampler when flush Signed-off-by: Maninblack --- src/pulsecore/protocol-native.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c index f64c190a5..27affe7c3 100644 --- a/src/pulsecore/protocol-native.c +++ b/src/pulsecore/protocol-native.c @@ -3967,6 +3967,8 @@ static void command_flush_record_stream(pa_pdispatch *pd, uint32_t command, uint CHECK_VALIDITY(c->pstream, s, tag, PA_ERR_NOENTITY); pa_memblockq_flush_read(s->memblockq); + pa_memblockq_flush_read(s->source_output->thread_info.delay_memblockq); + pa_resample_reset(s->source_output->thread_info.resampler); pa_pstream_send_simple_ack(c->pstream, tag); } -- Gitee From 0dd4dd1915e843079a1bdbd5d2773f1ea3766658 Mon Sep 17 00:00:00 2001 From: Maninblack Date: Fri, 30 May 2025 17:32:45 +0800 Subject: [PATCH 2/2] fix bug Signed-off-by: Maninblack --- src/pulsecore/protocol-native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c index 27affe7c3..f6c9d2da2 100644 --- a/src/pulsecore/protocol-native.c +++ b/src/pulsecore/protocol-native.c @@ -3968,7 +3968,7 @@ static void command_flush_record_stream(pa_pdispatch *pd, uint32_t command, uint pa_memblockq_flush_read(s->memblockq); pa_memblockq_flush_read(s->source_output->thread_info.delay_memblockq); - pa_resample_reset(s->source_output->thread_info.resampler); + pa_resampler_reset(s->source_output->thread_info.resampler); pa_pstream_send_simple_ack(c->pstream, tag); } -- Gitee