diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-06-29 12:04:12 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-06-29 12:04:12 +0100 |
commit | 0f558761aa2dee1017b4751e4017205e015a9560 (patch) | |
tree | 037df795519468a25d9362b4e95cdaeb84eb1cf9 /media-libs/libpulse/files | |
parent | 752d6256e5204b958b0ef7905675a940b5e9172f (diff) |
gentoo resync : 29.12.2022
Diffstat (limited to 'media-libs/libpulse/files')
-rw-r--r-- | media-libs/libpulse/files/pulseaudio-16.0-fix-pactl-volume-command.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/media-libs/libpulse/files/pulseaudio-16.0-fix-pactl-volume-command.patch b/media-libs/libpulse/files/pulseaudio-16.0-fix-pactl-volume-command.patch new file mode 100644 index 000000000000..469aaa345102 --- /dev/null +++ b/media-libs/libpulse/files/pulseaudio-16.0-fix-pactl-volume-command.patch @@ -0,0 +1,55 @@ +https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/05c06afa58e30b7958e96766d1e917099c8a4041 + +From 05c06afa58e30b7958e96766d1e917099c8a4041 Mon Sep 17 00:00:00 2001 +From: Sean Greenslade <sean@seangreenslade.com> +Date: Sat, 4 Jun 2022 00:24:49 -0700 +Subject: [PATCH] pactl: fix parsing of percentages with decimal points + +The logic for detecting which type of volume was given incorrectly interpreted +any value with a decimal as a VOL_LINEAR. It also could set multiple flags, +which would put the flags variable into an indeterminate state. Additionally, +the flags stack variable was uninitialized which could also lead to an +indeterminate flag state. + +Percentages are now prioritized over all other types, and only one type flag +can be set. +--- + src/utils/pactl.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/utils/pactl.c b/src/utils/pactl.c +index 35163f277..2761ebaaf 100644 +--- a/src/utils/pactl.c ++++ b/src/utils/pactl.c +@@ -2527,16 +2527,16 @@ static int parse_volume(const char *vol_spec, pa_volume_t *vol, enum volume_flag + vs = pa_xstrdup(vol_spec); + + *vol_flags = (pa_startswith(vs, "+") || pa_startswith(vs, "-")) ? VOL_RELATIVE : VOL_ABSOLUTE; +- if (strchr(vs, '.')) +- *vol_flags |= VOL_LINEAR; + if (pa_endswith(vs, "%")) { + *vol_flags |= VOL_PERCENT; + vs[strlen(vs)-1] = 0; + } +- if (pa_endswith(vs, "db") || pa_endswith(vs, "dB")) { ++ else if (pa_endswith(vs, "db") || pa_endswith(vs, "dB")) { + *vol_flags |= VOL_DECIBEL; + vs[strlen(vs)-2] = 0; + } ++ else if (strchr(vs, '.')) ++ *vol_flags |= VOL_LINEAR; + + atod_input = vs; + +@@ -2597,7 +2597,7 @@ static int parse_volumes(char *args[], unsigned n) { + + volume.channels = n; + for (i = 0; i < volume.channels; i++) { +- enum volume_flags flags; ++ enum volume_flags flags = 0; + + if (parse_volume(args[i], &volume.values[i], &flags) < 0) + return -1; +-- +GitLab + |