diff options
author | mva <mva@FreeBSD.org> | 2013-05-23 14:05:32 +0800 |
---|---|---|
committer | mva <mva@FreeBSD.org> | 2013-05-23 14:05:32 +0800 |
commit | 0e8cc26cca49c1f30e25de9f60f6fe4e1d95631b (patch) | |
tree | 48a1bd844cd1ec25fd53a7c559a8f67a85c6c41a /audio | |
parent | 811a03a9578efd40b55965649ff49060cc240066 (diff) | |
download | freebsd-ports-gnome-0e8cc26cca49c1f30e25de9f60f6fe4e1d95631b.tar.gz freebsd-ports-gnome-0e8cc26cca49c1f30e25de9f60f6fe4e1d95631b.tar.zst freebsd-ports-gnome-0e8cc26cca49c1f30e25de9f60f6fe4e1d95631b.zip |
- Fix a sound distortion issue for the OSS backend
PR: ports/178343
Submitted by: Yamagi Burmeister <yamagi@yamagi.org>
Diffstat (limited to 'audio')
-rw-r--r-- | audio/openal-soft/Makefile | 1 | ||||
-rw-r--r-- | audio/openal-soft/files/patch-Alc-ALu.c | 37 |
2 files changed, 38 insertions, 0 deletions
diff --git a/audio/openal-soft/Makefile b/audio/openal-soft/Makefile index 13bb0a13910d..6a55639cc575 100644 --- a/audio/openal-soft/Makefile +++ b/audio/openal-soft/Makefile @@ -2,6 +2,7 @@ PORTNAME= openal-soft PORTVERSION= 1.15.1 +PORTREVISION= 1 CATEGORIES= audio MASTER_SITES= http://kcat.strangesoft.net/openal-releases/ diff --git a/audio/openal-soft/files/patch-Alc-ALu.c b/audio/openal-soft/files/patch-Alc-ALu.c new file mode 100644 index 000000000000..5e673f703562 --- /dev/null +++ b/audio/openal-soft/files/patch-Alc-ALu.c @@ -0,0 +1,37 @@ +--- Alc/ALu.c.orig 2013-05-23 08:00:01.000000000 +0200 ++++ Alc/ALu.c 2013-05-23 08:01:20.000000000 +0200 +@@ -912,24 +912,27 @@ + } + + +-static __inline ALfloat aluF2F(ALfloat val) +-{ return val; } +-static __inline ALint aluF2I(ALfloat val) ++static __inline ALint aluF2I25(ALfloat val) + { + /* Clamp the value between -1 and +1. This handles that without branching. */ + val = val+1.0f - fabsf(val-1.0f); + val = (val-2.0f + fabsf(val+2.0f)) * 0.25f; +- /* Convert to a signed integer, between -2147483647 and +2147483647. */ +- return fastf2i((ALfloat)(val*2147483647.0)); ++ /* Convert to a signed integer, between -16777215 and +16777215. */ ++ return fastf2i(val*16777215.0f); + } ++ ++static __inline ALfloat aluF2F(ALfloat val) ++{ return val; } ++static __inline ALint aluF2I(ALfloat val) ++{ return aluF2I25(val)<<7; } + static __inline ALuint aluF2UI(ALfloat val) + { return aluF2I(val)+2147483648u; } + static __inline ALshort aluF2S(ALfloat val) +-{ return aluF2I(val)>>16; } ++{ return aluF2I(val)>>9; } + static __inline ALushort aluF2US(ALfloat val) + { return aluF2S(val)+32768; } + static __inline ALbyte aluF2B(ALfloat val) +-{ return aluF2I(val)>>24; } ++{ return aluF2I(val)>>17; } + static __inline ALubyte aluF2UB(ALfloat val) + { return aluF2B(val)+128; } + |