diff --git a/0001-audioconvert-ensure-temp-buffers-are-large-enough.patch b/0001-audioconvert-ensure-temp-buffers-are-large-enough.patch new file mode 100644 index 0000000..4617580 --- /dev/null +++ b/0001-audioconvert-ensure-temp-buffers-are-large-enough.patch @@ -0,0 +1,80 @@ +From 9af94508886b19bb398f4e2a777447ca42907c2f Mon Sep 17 00:00:00 2001 +From: Wim Taymans +Date: Fri, 1 Jul 2022 15:25:37 +0200 +Subject: [PATCH] audioconvert: ensure temp buffers are large enough + +Ensure that our temporary buffers can hold at least quantum_limit +samples. When no output or input is connected, we can generate up +to a quantum_limit of silence, which requires all the buffers to +be scaled correctly. + +Fixes a segfault in mpv. +--- + spa/plugins/audioconvert/audioconvert.c | 21 ++++++++++----------- + 1 file changed, 10 insertions(+), 11 deletions(-) + +diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c +index ae3e4d7c3..21a7ffea1 100644 +--- a/spa/plugins/audioconvert/audioconvert.c ++++ b/spa/plugins/audioconvert/audioconvert.c +@@ -221,9 +221,7 @@ struct impl { + uint32_t empty_size; + float *empty; + float *scratch; +- float *tmp; +- float *tmp2; +- ++ float *tmp[2]; + float *tmp_datas[2][MAX_PORTS]; + }; + +@@ -1491,9 +1489,9 @@ static int setup_convert(struct impl *th + return res; + + for (i = 0; i < MAX_PORTS; i++) { +- this->tmp_datas[0][i] = SPA_PTROFF(this->tmp, this->empty_size * i, void); ++ this->tmp_datas[0][i] = SPA_PTROFF(this->tmp[0], this->empty_size * i, void); + this->tmp_datas[0][i] = SPA_PTR_ALIGN(this->tmp_datas[0][i], MAX_ALIGN, void); +- this->tmp_datas[1][i] = SPA_PTROFF(this->tmp2, this->empty_size * i, void); ++ this->tmp_datas[1][i] = SPA_PTROFF(this->tmp[1], this->empty_size * i, void); + this->tmp_datas[1][i] = SPA_PTR_ALIGN(this->tmp_datas[1][i], MAX_ALIGN, void); + } + +@@ -2009,7 +2007,8 @@ impl_node_port_use_buffers(void *object, + + clear_buffers(this, port); + +- maxsize = 0; ++ maxsize = this->quantum_limit * sizeof(float); ++ + for (i = 0; i < n_buffers; i++) { + struct buffer *b; + uint32_t n_datas = buffers[i]->n_datas; +@@ -2050,10 +2049,10 @@ impl_node_port_use_buffers(void *object, + if (maxsize > this->empty_size) { + this->empty = realloc(this->empty, maxsize + MAX_ALIGN); + this->scratch = realloc(this->scratch, maxsize + MAX_ALIGN); +- this->tmp = realloc(this->tmp, (4 * maxsize + MAX_ALIGN) * MAX_PORTS); +- this->tmp2 = realloc(this->tmp2, (4 * maxsize + MAX_ALIGN) * MAX_PORTS); ++ this->tmp[0] = realloc(this->tmp[0], (maxsize + MAX_ALIGN) * MAX_PORTS); ++ this->tmp[1] = realloc(this->tmp[1], (maxsize + MAX_ALIGN) * MAX_PORTS); + if (this->empty == NULL || this->scratch == NULL || +- this->tmp == NULL || this->tmp2 == NULL) ++ this->tmp[0] == NULL || this->tmp[1] == NULL) + return -errno; + memset(this->empty, 0, maxsize + MAX_ALIGN); + this->empty_size = maxsize; +@@ -2641,8 +2640,8 @@ static int impl_clear(struct spa_handle + free(this->dir[SPA_DIRECTION_OUTPUT].ports[i]); + free(this->empty); + free(this->scratch); +- free(this->tmp); +- free(this->tmp2); ++ free(this->tmp[0]); ++ free(this->tmp[1]); + + if (this->resample.free) + resample_free(&this->resample); +-- +2.36.1 + diff --git a/0001-settings-remove-44.1KHz-from-allowed-rates-again.patch b/0001-settings-remove-44.1KHz-from-allowed-rates-again.patch deleted file mode 100644 index d59e94f..0000000 --- a/0001-settings-remove-44.1KHz-from-allowed-rates-again.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 16a7c274989f47b0c0d8ba192a30316b545bd26a Mon Sep 17 00:00:00 2001 -From: Wim Taymans -Date: Fri, 17 Jun 2022 09:02:13 +0200 -Subject: [PATCH] settings: remove 44.1KHz from allowed rates again - -It seems to cause too many problems. It people want rate switching they -can add an override themselves. ---- - src/daemon/minimal.conf.in | 2 +- - src/daemon/pipewire.conf.in | 2 +- - src/pipewire/settings.c | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/daemon/minimal.conf.in b/src/daemon/minimal.conf.in -index 49227dddf..8b3ba7640 100644 ---- a/src/daemon/minimal.conf.in -+++ b/src/daemon/minimal.conf.in -@@ -27,7 +27,7 @@ context.properties = { - - ## Properties for the DSP configuration. - #default.clock.rate = 48000 -- #default.clock.allowed-rates = [ 44100 48000 ] -+ #default.clock.allowed-rates = [ 48000 ] - #default.clock.quantum = 1024 - #default.clock.min-quantum = 32 - #default.clock.max-quantum = 2048 -diff --git a/src/daemon/pipewire.conf.in b/src/daemon/pipewire.conf.in -index 787e45f42..3b9f611b7 100644 ---- a/src/daemon/pipewire.conf.in -+++ b/src/daemon/pipewire.conf.in -@@ -27,7 +27,7 @@ context.properties = { - - ## Properties for the DSP configuration. - #default.clock.rate = 48000 -- #default.clock.allowed-rates = [ 44100 48000 ] -+ #default.clock.allowed-rates = [ 48000 ] - #default.clock.quantum = 1024 - default.clock.min-quantum = 16 - #default.clock.max-quantum = 2048 -diff --git a/src/pipewire/settings.c b/src/pipewire/settings.c -index 92d297ca3..c512e9658 100644 ---- a/src/pipewire/settings.c -+++ b/src/pipewire/settings.c -@@ -41,7 +41,7 @@ - #define NAME "settings" - - #define DEFAULT_CLOCK_RATE 48000u --#define DEFAULT_CLOCK_RATES "[ 44100 48000 ]" -+#define DEFAULT_CLOCK_RATES "[ 48000 ]" - #define DEFAULT_CLOCK_QUANTUM 1024u - #define DEFAULT_CLOCK_MIN_QUANTUM 32u - #define DEFAULT_CLOCK_MAX_QUANTUM 2048u --- -GitLab - diff --git a/_service b/_service index 589da96..543de45 100644 --- a/_service +++ b/_service @@ -3,7 +3,7 @@ git https://gitlab.freedesktop.org/pipewire/pipewire.git - refs/tags/0.3.52 + refs/tags/0.3.53 @PARENT_TAG@