Mercurial > hg > xemacs-beta
comparison src/linuxplay.c @ 380:8626e4521993 r21-2-5
Import from CVS: tag r21-2-5
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:07:10 +0200 |
parents | d883f39b8495 |
children | 74fd4e045ea6 |
comparison
equal
deleted
inserted
replaced
379:76b7d63099ad | 380:8626e4521993 |
---|---|
818 | 818 |
819 if (ioctl(auddio_fd,SNDCTL_DSP_SYNC,NULL) < 0) { | 819 if (ioctl(auddio_fd,SNDCTL_DSP_SYNC,NULL) < 0) { |
820 perror("SNDCTL_DSP_SYNC"); | 820 perror("SNDCTL_DSP_SYNC"); |
821 return(0); } | 821 return(0); } |
822 | 822 |
823 /* Initialize sound hardware with prefered parameters */ | 823 /* Initialize sound hardware with preferred parameters */ |
824 | 824 |
825 /* If the sound hardware cannot support 16 bit format or requires a | 825 /* If the sound hardware cannot support 16 bit format or requires a |
826 different byte sex then try to drop to 8 bit format */ | 826 different byte sex then try to drop to 8 bit format */ |
827 | 827 |
828 the_fmt = fmt; | 828 the_fmt = fmt; |
991 if (ffmt != fmtRaw && ffmt != fmtSunAudio && ffmt != fmtWave) { | 991 if (ffmt != fmtRaw && ffmt != fmtSunAudio && ffmt != fmtWave) { |
992 warn("Unsupported file format (neither RAW, nor Sun/DECAudio, nor WAVE)"); | 992 warn("Unsupported file format (neither RAW, nor Sun/DECAudio, nor WAVE)"); |
993 return; } | 993 return; } |
994 | 994 |
995 /* The VoxWare-SDK discourages opening /dev/audio; opening /dev/dsp and | 995 /* The VoxWare-SDK discourages opening /dev/audio; opening /dev/dsp and |
996 properly intializing it via ioctl() is prefered */ | 996 properly initializing it via ioctl() is preferred */ |
997 if ((audio_fd=open(audio_dev, | 997 if ((audio_fd=open(audio_dev, O_WRONLY | O_NONBLOCK, 0)) < 0) { |
998 (O_WRONLY|O_NDELAY),0)) < 0) { | |
999 perror(audio_dev); | 998 perror(audio_dev); |
1000 if (mix_fd > 0 && mix_fd != audio_fd) { close(mix_fd); mix_fd = -1; } | 999 if (mix_fd > 0 && mix_fd != audio_fd) { close(mix_fd); mix_fd = -1; } |
1001 return; } | 1000 return; } |
1002 | 1001 |
1003 /* The VoxWare-SDK discourages direct manipulation of the mixer device as | 1002 /* The VoxWare-SDK discourages direct manipulation of the mixer device as |