fix 8293.patch #2
This commit is contained in:
parent
e1f679954b
commit
f960549276
37
debian/patches/8293.patch
vendored
37
debian/patches/8293.patch
vendored
@ -1,23 +1,7 @@
|
|||||||
From 9b5bbe118f0d09c5ed015fb66676cd48ad9fb1ae Mon Sep 17 00:00:00 2001
|
diff '--color=auto' -ru a/plugins/linux-pipewire/pipewire.c b/plugins/linux-pipewire/pipewire.c
|
||||||
From: columbarius <co1umbarius@protonmail.com>
|
--- a/plugins/linux-pipewire/pipewire.c 2023-02-04 13:17:10.000000000 +0300
|
||||||
Date: Sat, 21 Jan 2023 08:45:38 +0100
|
+++ b/plugins/linux-pipewire/pipewire.c 2023-03-04 20:51:36.512199751 +0300
|
||||||
Subject: [PATCH] pipewire: calc spa buffer size
|
@@ -125,6 +125,41 @@
|
||||||
|
|
||||||
Modern GPUs might support a lot of modifiers. As such the hardcoded size
|
|
||||||
for the ENUM_Formats PipeWire params are not enough and we should
|
|
||||||
calculate the required size manually.
|
|
||||||
|
|
||||||
Added logs if a ENUM_Format can't be assembled, which happens when the
|
|
||||||
buffer size was not large enough.
|
|
||||||
---
|
|
||||||
plugins/linux-pipewire/pipewire.c | 47 +++++++++++++++++++++++++++++--
|
|
||||||
1 file changed, 45 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/plugins/linux-pipewire/pipewire.c b/plugins/linux-pipewire/pipewire.c
|
|
||||||
index 444259b965c12..d1ff3e33fc410 100644
|
|
||||||
--- a/plugins/linux-pipewire/pipewire.c
|
|
||||||
+++ b/plugins/linux-pipewire/pipewire.c
|
|
||||||
@@ -144,6 +144,41 @@ static void update_pw_versions(obs_pipewire *obs_pw, const char *version)
|
|
||||||
blog(LOG_WARNING, "[pipewire] failed to parse server version");
|
blog(LOG_WARNING, "[pipewire] failed to parse server version");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,10 +40,10 @@ index 444259b965c12..d1ff3e33fc410 100644
|
|||||||
+ return size;
|
+ return size;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
static void teardown_pipewire(obs_pipewire *obs_pw)
|
static void teardown_pipewire(obs_pipewire_data *obs_pw)
|
||||||
{
|
{
|
||||||
if (obs_pw->thread_loop) {
|
if (obs_pw->thread_loop) {
|
||||||
@@ -338,6 +373,10 @@ static bool build_format_params(obs_pipewire *obs_pw,
|
@@ -319,6 +354,10 @@
|
||||||
obs_pw->format_info.array[i].spa_format,
|
obs_pw->format_info.array[i].spa_format,
|
||||||
obs_pw->format_info.array[i].modifiers.array,
|
obs_pw->format_info.array[i].modifiers.array,
|
||||||
obs_pw->format_info.array[i].modifiers.num);
|
obs_pw->format_info.array[i].modifiers.num);
|
||||||
@ -70,7 +54,7 @@ index 444259b965c12..d1ff3e33fc410 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
build_shm:
|
build_shm:
|
||||||
@@ -345,6 +384,10 @@ static bool build_format_params(obs_pipewire *obs_pw,
|
@@ -326,6 +365,10 @@
|
||||||
params[params_count++] = build_format(
|
params[params_count++] = build_format(
|
||||||
pod_builder, &obs_pw->video_info,
|
pod_builder, &obs_pw->video_info,
|
||||||
obs_pw->format_info.array[i].spa_format, NULL, 0);
|
obs_pw->format_info.array[i].spa_format, NULL, 0);
|
||||||
@ -81,7 +65,7 @@ index 444259b965c12..d1ff3e33fc410 100644
|
|||||||
}
|
}
|
||||||
*param_list = params;
|
*param_list = params;
|
||||||
*n_params = params_count;
|
*n_params = params_count;
|
||||||
@@ -451,7 +494,7 @@ static void renegotiate_format(void *data, uint64_t expirations)
|
@@ -432,7 +475,7 @@
|
||||||
|
|
||||||
pw_thread_loop_lock(obs_pw->thread_loop);
|
pw_thread_loop_lock(obs_pw->thread_loop);
|
||||||
|
|
||||||
@ -90,11 +74,12 @@ index 444259b965c12..d1ff3e33fc410 100644
|
|||||||
struct spa_pod_builder pod_builder =
|
struct spa_pod_builder pod_builder =
|
||||||
SPA_POD_BUILDER_INIT(params_buffer, sizeof(params_buffer));
|
SPA_POD_BUILDER_INIT(params_buffer, sizeof(params_buffer));
|
||||||
uint32_t n_params;
|
uint32_t n_params;
|
||||||
@@ -897,7 +940,7 @@ void obs_pipewire_connect_stream(obs_pipewire *obs_pw, int pipewire_node,
|
@@ -757,7 +800,7 @@
|
||||||
struct spa_pod_builder pod_builder;
|
struct spa_pod_builder pod_builder;
|
||||||
const struct spa_pod **params = NULL;
|
const struct spa_pod **params = NULL;
|
||||||
uint32_t n_params;
|
uint32_t n_params;
|
||||||
- uint8_t params_buffer[2048];
|
- uint8_t params_buffer[2048];
|
||||||
+ uint8_t params_buffer[calc_spa_enumformat_buffer_size(obs_pw)];
|
+ uint8_t params_buffer[calc_spa_enumformat_buffer_size(obs_pw)];
|
||||||
|
|
||||||
pw_thread_loop_lock(obs_pw->thread_loop);
|
obs_pw->thread_loop = pw_thread_loop_new("PipeWire thread loop", NULL);
|
||||||
|
obs_pw->context = pw_context_new(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user