From 7f3ca6c524d01d92f756909ccdf877bccd627808 Mon Sep 17 00:00:00 2001 From: Misaki Kasumi Date: Sun, 31 Mar 2024 07:31:34 +0800 Subject: [PATCH] ao_pipewire: fix buffer size calculation `ao->sstride` is alrady initialized to the same value in `init()` but in addition it can also handle planar formats. --- audio/out/ao_pipewire.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/out/ao_pipewire.c b/audio/out/ao_pipewire.c index ee97e8f8e8..a03f172529 100644 --- a/audio/out/ao_pipewire.c +++ b/audio/out/ao_pipewire.c @@ -226,7 +226,7 @@ static void on_param_changed(void *userdata, uint32_t id, const struct spa_pod * if (param == NULL || id != SPA_PARAM_Format) return; - int buffer_size = ao->device_buffer * af_fmt_to_bytes(ao->format) * ao->channels.num; + int buffer_size = ao->device_buffer * ao->sstride; params[0] = spa_pod_builder_add_object(&b, SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers,