- if (snd_inited)
- {
- // unmap the memory
- munmap(shm->buffer, shm->bufferlength);
- // stop the sound
- tmp = 0;
- ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &tmp);
- ioctl(audio_fd, SNDCTL_DSP_RESET, 0);
- // close the device
- close(audio_fd);
- audio_fd = -1;
- snd_inited = 0;
- }
+ // unmap the memory
+ munmap(shm->buffer, shm->bufferlength);
+ // stop the sound
+ tmp = 0;
+ ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &tmp);
+ ioctl(audio_fd, SNDCTL_DSP_RESET, 0);
+ // close the device
+ close(audio_fd);
+ audio_fd = -1;