commit:     bdf35f42b82cb025d8003dc4b9c6feafab1c8e99
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri May 19 04:14:33 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 19 04:14:40 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bdf35f42

media-video/pipewire: backport recommended JACK patch

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../0.3.71/jack-update-bufsize-samplerate.patch    | 46 ++++++++++++++++++++++
 ...ire-0.3.71.ebuild => pipewire-0.3.71-r1.ebuild} |  0
 2 files changed, 46 insertions(+)

diff --git 
a/media-video/pipewire/files/0.3.71/jack-update-bufsize-samplerate.patch 
b/media-video/pipewire/files/0.3.71/jack-update-bufsize-samplerate.patch
new file mode 100644
index 000000000000..59fb89a3e017
--- /dev/null
+++ b/media-video/pipewire/files/0.3.71/jack-update-bufsize-samplerate.patch
@@ -0,0 +1,46 @@
+https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3226
+https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/ce71b37b58d5e251ae7acda0799f696688df11c2
+
+From ce71b37b58d5e251ae7acda0799f696688df11c2 Mon Sep 17 00:00:00 2001
+From: Wim Taymans <[email protected]>
+Date: Thu, 18 May 2023 09:59:26 +0200
+Subject: [PATCH] jack: update bufsize and samplerate when skipping notify
+
+When we skip the notify because we are not active or we don't have a
+callback, still update the buffer_size and sample_rate fields or else
+we will keep on trying forever.
+
+Fixes #3226
+--- a/pipewire-jack/src/pipewire-jack.c
++++ b/pipewire-jack/src/pipewire-jack.c
+@@ -1027,8 +1027,6 @@ static int queue_notify(struct client *c, int type, 
struct object *o, int arg1,
+       struct notify *notify;
+       bool emit = false;;
+ 
+-      if ((type & NOTIFY_ACTIVE_FLAG) && !c->active)
+-              return 0;
+       switch (type) {
+       case NOTIFY_TYPE_REGISTRATION:
+               emit = c->registration_callback != NULL && o != NULL;
+@@ -1060,8 +1058,18 @@ static int queue_notify(struct client *c, int type, 
struct object *o, int arg1,
+       default:
+               break;
+       }
++      if ((type & NOTIFY_ACTIVE_FLAG) && !c->active)
++              emit = false;
+       if (!emit) {
+-              pw_log_debug("%p: skip notify %d", c, type);
++              switch (type) {
++              case NOTIFY_TYPE_BUFFER_FRAMES:
++                      c->buffer_frames = arg1;
++                      break;
++              case NOTIFY_TYPE_SAMPLE_RATE:
++                      c->sample_rate = arg1;
++                      break;
++              }
++              pw_log_debug("%p: skip notify %08x active:%d", c, type, 
c->active);
+               if (o != NULL && arg1 == 0 && o->removing) {
+                       o->removing = false;
+                       free_object(c, o);
+-- 
+GitLab

diff --git a/media-video/pipewire/pipewire-0.3.71.ebuild 
b/media-video/pipewire/pipewire-0.3.71-r1.ebuild
similarity index 100%
rename from media-video/pipewire/pipewire-0.3.71.ebuild
rename to media-video/pipewire/pipewire-0.3.71-r1.ebuild

Reply via email to