void-packages/srcpkgs/moc/patches/move-pcm-buffer-to-heap.patch
Đoàn Trần Công Danh 765e304c4b srcpkgs/m*: convert patches to -Np1
```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

28 lines
714 B
Diff

--- a/player.c 2018-02-10 23:53:38.627091352 +0100
+++ b/player.c 2018-02-10 23:54:46.672519217 +0100
@@ -444,7 +444,7 @@
{
bool eof = false;
bool stopped = false;
- char buf[PCM_BUF_SIZE];
+ char *const buf = xmalloc (PCM_BUF_SIZE);
int decoded = 0;
struct sound_params new_sound_params;
bool sound_params_change = false;
@@ -486,7 +486,7 @@
status_msg ("Playing...");
}
- decoded = f->decode (decoder_data, buf, sizeof(buf),
+ decoded = f->decode (decoder_data, buf, PCM_BUF_SIZE,
&new_sound_params);
if (decoded)
@@ -629,6 +629,7 @@
precache.f->close (precache.decoder_data);
precache_reset (&precache);
}
+ free (buf);
}
#if !defined(NDEBUG) && defined(DEBUG)