summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lingot-audio-oss.c15
-rw-r--r--src/lingot-core.c2
2 files changed, 17 insertions, 0 deletions
diff --git a/src/lingot-audio-oss.c b/src/lingot-audio-oss.c
index ee43ae6..1e1b998 100644
--- a/src/lingot-audio-oss.c
+++ b/src/lingot-audio-oss.c
@@ -20,11 +20,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifdef OSS
#include <sys/soundcard.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/errno.h>
+#endif
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
@@ -38,6 +40,9 @@
LingotAudioHandler* lingot_audio_oss_new(char* device, int sample_rate) {
+ LingotAudioHandler* audio = NULL;
+
+#ifdef OSS
int channels = 1;
int format = SAMPLE_FORMAT;
char error_message[100];
@@ -107,17 +112,25 @@ LingotAudioHandler* lingot_audio_oss_new(char* device, int sample_rate) {
lingot_msg_add_error(exception);
}
+# else
+ lingot_msg_add_error(
+ _("The application has not been built with OSS support"));
+# endif
+
return audio;
}
void lingot_audio_oss_destroy(LingotAudioHandler* audio) {
+#ifdef OSS
if (audio != NULL) {
close(audio->dsp);
free(audio->read_buffer);
}
+#endif
}
int lingot_audio_oss_read(LingotAudioHandler* audio) {
+#ifdef OSS
int i;
int read_size;
@@ -140,6 +153,8 @@ int lingot_audio_oss_read(LingotAudioHandler* audio) {
audio->flt_read_buffer[i] = audio->read_buffer[i];
}
+#endif
+
return 0;
}
diff --git a/src/lingot-core.c b/src/lingot-core.c
index 0d5c31f..d5883c4 100644
--- a/src/lingot-core.c
+++ b/src/lingot-core.c
@@ -22,7 +22,9 @@
#include <stdio.h>
#include <math.h>
+#ifdef OSS
#include <sys/soundcard.h>
+#endif
#include <string.h>
#include <errno.h>
#include <sys/time.h>