diff options
author | Alejandro Pulver <alepulver@FreeBSD.org> | 2006-09-03 03:43:29 +0000 |
---|---|---|
committer | Alejandro Pulver <alepulver@FreeBSD.org> | 2006-09-03 03:43:29 +0000 |
commit | 74e3bb7a35cc4fcae99e66e176293ef65248aa30 (patch) | |
tree | 2bf8f5b5f913ac3b210d60c567e0f08ab6a277c5 /games/fteqw/files/patch-client__snd_linux.c | |
parent | 545492f4aee2765ae30571c2f5acc71c41518e00 (diff) | |
download | ports-74e3bb7a35cc4fcae99e66e176293ef65248aa30.tar.gz ports-74e3bb7a35cc4fcae99e66e176293ef65248aa30.zip |
Notes
Diffstat (limited to 'games/fteqw/files/patch-client__snd_linux.c')
-rw-r--r-- | games/fteqw/files/patch-client__snd_linux.c | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/games/fteqw/files/patch-client__snd_linux.c b/games/fteqw/files/patch-client__snd_linux.c new file mode 100644 index 000000000000..efe25ad5f21b --- /dev/null +++ b/games/fteqw/files/patch-client__snd_linux.c @@ -0,0 +1,82 @@ +--- ./client/snd_linux.c.orig Tue Jul 18 00:34:50 2006 ++++ ./client/snd_linux.c Sat Sep 2 18:40:11 2006 +@@ -115,14 +115,6 @@ + return 0; + } + +- if (ioctl(sc->audio_fd, SNDCTL_DSP_GETOSPACE, &info)==-1) +- { +- perror("GETOSPACE"); +- Con_Printf(S_ERROR "OSS: Um, can't do GETOSPACE?\n"); +- OSS_Shutdown(sc); +- return 0; +- } +- + sc->sn.splitbuffer = 0; + + // set sample bits & speed +@@ -152,27 +144,6 @@ + sc->sn.speed = tryrates[i]; + } + +- if (sc->sn.samples > (info.fragstotal * info.fragsize * 4)) +- { +- Con_Printf(S_NOTICE "OSS: Enabling bigfoot's mmap hack! Hope you know what you're doing!\n"); +- sc->sn.samples = info.fragstotal * info.fragsize * 4; +- } +- sc->sn.samples = info.fragstotal * info.fragsize; +- sc->sn.submission_chunk = 1; +- +-// memory map the dma buffer +- +- sc->sn.buffer = (unsigned char *) mmap(NULL, sc->sn.samples, PROT_WRITE, MAP_FILE|MAP_SHARED, sc->audio_fd, 0); +- if (!sc->sn.buffer) +- { +- perror(snddev); +- Con_Printf(S_ERROR "OSS: Could not mmap %s\n", snddev); +- OSS_Shutdown(sc); +- return 0; +- } +- +- sc->sn.samples /= (sc->sn.samplebits/8); +- + tmp = 0; + if (sc->sn.numchannels == 2) + tmp = 1; +@@ -228,6 +199,36 @@ + Con_Printf(S_ERROR "OSS: %d-bit sound not supported.\n", sc->sn.samplebits); + OSS_Shutdown(sc); + return 0; ++ } ++ ++ if (ioctl(sc->audio_fd, SNDCTL_DSP_GETOSPACE, &info)==-1) ++ { ++ perror("GETOSPACE"); ++ Con_Printf(S_ERROR "OSS: Um, can't do GETOSPACE?\n"); ++ OSS_Shutdown(sc); ++ return 0; ++ } ++ ++ sc->sn.samples = info.fragstotal * info.fragsize; ++ sc->sn.submission_chunk = 1; ++ ++// memory map the dma buffer ++ ++ sc->sn.buffer = (unsigned char *) mmap(NULL, sc->sn.samples, PROT_WRITE, MAP_FILE|MAP_SHARED, sc->audio_fd, 0); ++ if (!sc->sn.buffer) ++ { ++ perror(snddev); ++ Con_Printf(S_ERROR "OSS: Could not mmap %s\n", snddev); ++ OSS_Shutdown(sc); ++ return 0; ++ } ++ ++ sc->sn.samples /= (sc->sn.samplebits/8); ++ ++ if (sc->sn.samples > (info.fragstotal * info.fragsize * 4)) ++ { ++ Con_Printf(S_NOTICE "OSS: Enabling bigfoot's mmap hack! Hope you know what you're doing!\n"); ++ sc->sn.samples = info.fragstotal * info.fragsize * 4; + } + + // toggle the trigger & start her up |