diff options
author | Andrew Savchenko <bircoph@gentoo.org> | 2020-05-11 01:26:03 +0300 |
---|---|---|
committer | Andrew Savchenko <bircoph@gentoo.org> | 2020-05-11 01:28:02 +0300 |
commit | e5cea54453c0241f41e2a001225c193f829d947d (patch) | |
tree | 16210ae7ec6de8e267ff9b208da59bf812908e3a /media-sound/apulse/files | |
parent | media-tv/tvheadend: Fix bad quoting in systemd service file (diff) | |
download | gentoo-e5cea54453c0241f41e2a001225c193f829d947d.tar.gz gentoo-e5cea54453c0241f41e2a001225c193f829d947d.tar.bz2 gentoo-e5cea54453c0241f41e2a001225c193f829d947d.zip |
media-sound/apulse: version bump
- Update to 0.1.13
- Bump to EAPI 7
- Migrate from cmake-utils to cmake eclass
- Use upstream full requests:
- Check key before removal from hash table
- Improve man page
Closes: https://bugs.gentoo.org/720340
Package-Manager: Portage-2.3.82, Repoman-2.3.20
Signed-off-by: Andrew Savchenko <bircoph@gentoo.org>
Diffstat (limited to 'media-sound/apulse/files')
-rw-r--r-- | media-sound/apulse/files/check-key-before-remove.patch | 54 | ||||
-rw-r--r-- | media-sound/apulse/files/man.patch | 30 |
2 files changed, 84 insertions, 0 deletions
diff --git a/media-sound/apulse/files/check-key-before-remove.patch b/media-sound/apulse/files/check-key-before-remove.patch new file mode 100644 index 000000000000..28fe0fc0d168 --- /dev/null +++ b/media-sound/apulse/files/check-key-before-remove.patch @@ -0,0 +1,54 @@ +From bf146f0d711ce3e48cdc8ba772039d843d590b47 Mon Sep 17 00:00:00 2001 +From: "Miouyouyou (Myy)" <myy@miouyouyou.fr> +Date: Sun, 20 Oct 2019 05:09:29 +0200 +Subject: [PATCH] stream: Check the key before invoking g_hash_table_remove + +Turns out that I hit a bug where pa_stream_unref would +call g_hash_table_remove with a NULL key. + +Thanks for the lightweight and smooth error handling from +Glib, g_hash_table_remove generated an ABORT call, crashing +some Unity3D games I was trying to start. +Now, you also CANNOT call g_hash_table_lookup with a NULL +key. That also generate a crash... Ugh... + +So, yeah, we first check that the key is not 0, then check +if the key is actually inside the Hash table and THEN remove +it. + +Note, here's my ~/.asoundrc, just in case : +defaults.pcm.!card Audio +defaults.ctl.!card Audio + +Audio being : +card 3: Audio [DigiHug USB Audio], device 0: USB Audio [USB Audio] + Subdevices: 0/1 + Subdevice #0: subdevice #0 +card 3: Audio [DigiHug USB Audio], device 1: USB Audio [USB Audio #1] + Subdevices: 1/1 + Subdevice #0: subdevice #0 + +I'm using a FiiO device for sound output. + +Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr> +--- + src/apulse-stream.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/apulse-stream.c b/src/apulse-stream.c +index 84b18bb..1de4885 100644 +--- a/src/apulse-stream.c ++++ b/src/apulse-stream.c +@@ -1019,7 +1019,11 @@ pa_stream_unref(pa_stream *s) + + s->ref_cnt--; + if (s->ref_cnt == 0) { +- g_hash_table_remove(s->c->streams_ht, GINT_TO_POINTER(s->idx)); ++ GHashTable * __restrict const streams_ht = ++ s->c->streams_ht; ++ void const * key = GINT_TO_POINTER(s->idx); ++ if (key && g_hash_table_lookup(streams_ht, key)) ++ g_hash_table_remove(streams_ht, key); + ringbuffer_free(s->rb); + free(s->peek_buffer); + free(s->write_buffer); diff --git a/media-sound/apulse/files/man.patch b/media-sound/apulse/files/man.patch new file mode 100644 index 000000000000..a26e32d8b9c0 --- /dev/null +++ b/media-sound/apulse/files/man.patch @@ -0,0 +1,30 @@ +From 2c2bf366599d957837acbdf54eb300526fc125a1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com> +Date: Tue, 5 May 2020 14:24:52 -0300 +Subject: [PATCH] Add ENVIRONMENT to man-page. + +--- + man/apulse.1 | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/man/apulse.1 b/man/apulse.1 +index cd67cf3..df75c60 100644 +--- a/man/apulse.1 ++++ b/man/apulse.1 +@@ -36,6 +36,16 @@ compatibility layer between OSS programs and \fBALSA\fR, \fBapulse\fR was + designed to be compatibility layer between PulseAudio applications and + \fBALSA\fR. + ++.SH ENVIRONMENT ++ ++The following environment variables can be used to configure the devices used ++by \fBapulse\fR. Try \fIhw:0,0\fR, \fIplughw:0,0\fR and the like. ++Refer to the ALSA user guide for a full list of device names. ++ ++\fIAPULSE_CAPTURE_DEVICE\fR: Can be used to configure the capture device. ++ ++\fIAPULSE_PLAYBACK_DEVICE\fR: Can be used to configure the playback device. ++ + .SH RETURN VALUE + + \fBapulse\fR is a simple shell wrapper script that calls \fBexec\fR on the |