void-packages/srcpkgs/pcaudiolib/patches/upstream-fix-alsa-sample-size.patch
Đoàn Trần Công Danh 49cb564d14 srcpkgs/p*: convert patches to -Np1
* par is kept at -Np0

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

19 lines
726 B
Diff

commit d6a6b00aa4334b461c1a09c27b6c681eaac8da8a
Author: Martin Schreiber <mse00000@gmail.com>
Date: Sat Mar 10 06:55:58 2018 +0100
* Alsa: fixed sample_size calculation, multiply with channel count.
diff --git src/alsa.c src/alsa.c
index 34e39be..6af1941 100644
--- a/src/alsa.c
+++ b/src/alsa.c
@@ -53,7 +53,7 @@ alsa_object_open(struct audio_object *object,
return -EEXIST;
snd_pcm_format_t pcm_format;
-#define FORMAT(srcfmt, dstfmt, size) case srcfmt: pcm_format = dstfmt; self->sample_size = size; break;
+#define FORMAT(srcfmt, dstfmt, size) case srcfmt: pcm_format = dstfmt; self->sample_size = size*channels; break;
switch (format)
{
FORMAT(AUDIO_OBJECT_FORMAT_ALAW, SND_PCM_FORMAT_A_LAW, 1)