pipewire: add patches for bluetooth support
[AGL/meta-agl-devel.git] / meta-pipewire / recipes-multimedia / pipewire / pipewire / 0016-a2dpsink-fix-infinite-loop-when-buffer-could-not-be-.patch
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0016-a2dpsink-fix-infinite-loop-when-buffer-could-not-be-.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0016-a2dpsink-fix-infinite-loop-when-buffer-could-not-be-.patch
new file mode 100644 (file)
index 0000000..d747a7a
--- /dev/null
@@ -0,0 +1,32 @@
+From c186e40905f78f41cbc015da0e204735a0398450 Mon Sep 17 00:00:00 2001
+From: Julian Bouzas <julian.bouzas@collabora.com>
+Date: Fri, 19 Jul 2019 08:38:21 -0400
+Subject: [PATCH] a2dpsink: fix infinite loop when buffer could not be encoded
+
+Upstream-Status: Backport [4b202b965665bbcb55194b4ab827984e5804e3e0]
+---
+ spa/plugins/bluez5/a2dp-sink.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/spa/plugins/bluez5/a2dp-sink.c b/spa/plugins/bluez5/a2dp-sink.c
+index 731577e5..d6d9e7d6 100644
+--- a/spa/plugins/bluez5/a2dp-sink.c
++++ b/spa/plugins/bluez5/a2dp-sink.c
+@@ -558,8 +558,13 @@ static int flush_data(struct impl *this, uint64_t now_time)
+               n_bytes = add_data(this, src + offs, l0);
+               if (n_bytes > 0 && l1 > 0)
+                       n_bytes += add_data(this, src, l1);
+-              if (n_bytes <= 0)
++              if (n_bytes <= 0) {
++                      spa_list_remove(&b->link);
++                      b->outstanding = true;
++                      spa_node_call_reuse_buffer(&this->callbacks, 0, b->id);
++                      port->ready_offset = 0;
+                       break;
++              }
+               n_frames = n_bytes / port->frame_size;
+-- 
+2.23.0.rc1
+