Skip to content

Commit

Permalink
[pipewire] 1.0.0-2: fix/update patch from libudev issue
Browse files Browse the repository at this point in the history
  • Loading branch information
YukariChiba committed Dec 28, 2023
1 parent 1c1e584 commit 46585ed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
4 changes: 2 additions & 2 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pkgname=pipewire
pkgver=1.0.0
pkgrel=1
pkgrel=2
pkgdesc="Low-latency audio/video router and processor"
url="https://pipewire.org"
arch=(x86_64 aarch64 riscv64)
Expand All @@ -14,7 +14,7 @@ source=(
fix-udev-zero.patch
)
sha256sums=('f91ef1d1161b37aae6e21b9671917d97097e2664c83d919ba3a0793d6fbc543d'
'd23a7ae266619ca46d1d4cc135e6e6d31f0dfd798704d7a7a961a5304e614990')
'5e41f524ac1112cc093858412d948637d31d42da989a1a4ad562aef83f6dda37')

prepare()
{
Expand Down
27 changes: 11 additions & 16 deletions fix-udev-zero.patch
Original file line number Diff line number Diff line change
@@ -1,36 +1,31 @@
--- pipewire/spa/plugins/alsa/alsa-udev.c
+++ pipewire/spa/plugins/alsa/alsa-udev.c
@@ -162,9 +162,6 @@
diff --git a/spa/plugins/alsa/alsa-udev.c b/spa/plugins/alsa/alsa-udev.c
index 58ff5032d..b0b7a945d 100644
--- a/spa/plugins/alsa/alsa-udev.c
+++ b/spa/plugins/alsa/alsa-udev.c
@@ -162,8 +162,6 @@ static unsigned int get_card_nr(struct impl *this, struct udev_device *udev_devi
if ((str = udev_device_get_property_value(udev_device, "SOUND_CLASS")) && spa_streq(str, "modem"))
return SPA_ID_INVALID;

- if (udev_device_get_property_value(udev_device, "SOUND_INITIALIZED") == NULL)
- return SPA_ID_INVALID;
-
if ((str = udev_device_get_property_value(udev_device, "DEVPATH")) == NULL)
return SPA_ID_INVALID;

@@ -958,7 +955,7 @@
@@ -982,7 +982,7 @@ static int enum_cards(struct impl *this)

for (udev_devices = udev_enumerate_get_list_entry(enumerate); udev_devices;
udev_devices = udev_list_entry_get_next(udev_devices)) {
- struct udev_device *udev_device;
+ struct udev_device *udev_device, *pdev_device;
+ struct udev_device *udev_device, *pdev;

udev_device = udev_device_new_from_syspath(this->udev,
udev_list_entry_get_name(udev_devices));
@@ -967,6 +964,14 @@
@@ -991,6 +991,8 @@ static int enum_cards(struct impl *this)

process_card(this, ACTION_ADD, udev_device);

+ pdev_device = udev_device_get_parent(udev_device);
+ if (pdev_device) {
+ process_card(this, ACTION_ADD, pdev_device);
+ }
+
+ /* no need to call udev_device_unref(pdev) here.
+ udev_device_unref() will free parent device implicitly */
+
+ if ((pdev = udev_device_get_parent(udev_device)))
+ process_card(this, ACTION_ADD, pdev);
udev_device_unref(udev_device);
}
udev_enumerate_unref(enumerate);

0 comments on commit 46585ed

Please sign in to comment.