From 6c8b7b6f17c5e6cbbe35fa8454beff114b99fbe8 Mon Sep 17 00:00:00 2001 From: pvalchev Date: Mon, 16 Jun 2003 04:30:57 +0000 Subject: [PATCH] Fix corrupted 16bit .wav files generation on big endian platforms; from unzel miod Bump patchlevel to p3 to distinguish fixed version --- audio/libmikmod/Makefile | 4 ++-- .../libmikmod/patches/patch-drivers_drv_wav_c | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 audio/libmikmod/patches/patch-drivers_drv_wav_c diff --git a/audio/libmikmod/Makefile b/audio/libmikmod/Makefile index 8a2936bcf94..e1f91202ab3 100644 --- a/audio/libmikmod/Makefile +++ b/audio/libmikmod/Makefile @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile,v 1.5 2002/12/29 19:29:56 fgsch Exp $ +# $OpenBSD: Makefile,v 1.6 2003/06/16 04:30:57 pvalchev Exp $ COMMENT= "mikmod sound library" VERSION= 3.1.10 DISTNAME= libmikmod-${VERSION} -PKGNAME= ${DISTNAME}p2 +PKGNAME= ${DISTNAME}p3 CATEGORIES= audio devel HOMEPAGE= http://www.mikmod.org diff --git a/audio/libmikmod/patches/patch-drivers_drv_wav_c b/audio/libmikmod/patches/patch-drivers_drv_wav_c new file mode 100644 index 00000000000..5abc0ee0418 --- /dev/null +++ b/audio/libmikmod/patches/patch-drivers_drv_wav_c @@ -0,0 +1,21 @@ +$OpenBSD: patch-drivers_drv_wav_c,v 1.1 2003/06/16 04:30:57 pvalchev Exp $ +--- drivers/drv_wav.c.orig Sat Jan 12 18:00:14 2002 ++++ drivers/drv_wav.c Sun Jun 15 22:26:13 2003 +@@ -148,6 +148,17 @@ static void WAV_Update(void) + ULONG done; + + done=VC_WriteBytes(audiobuffer,BUFFERSIZE); ++#if BYTE_ORDER == BIG_ENDIAN ++ if (md_mode & DMODE_16BITS) { ++ ULONG i; ++ SWORD *w = audiobuffer; ++ ++ for (i = 0; i < done; i += 2) { ++ *w = ((*w & 0xff) << 8) | ((*w & 0xff00) >> 8); ++ w++; ++ } ++ } ++#endif + _mm_write_UBYTES(audiobuffer,done,wavout); + dumpsize+=done; + }