diff options
| author | Piotr Pawlow <pp@siedziba.pl> | 2014-03-13 21:52:10 +0100 |
|---|---|---|
| committer | Piotr Pawlow <pp@siedziba.pl> | 2014-03-13 21:52:10 +0100 |
| commit | 9bc63f42d03ef071132142c2462b03b992b95f3b (patch) | |
| tree | d520af2bbba4b63a9fa78393fe934df50a1e3f29 /src | |
| parent | fc1d5b7ea733fa73e17f9499f04f02bf06c051c1 (diff) | |
- make OSS backend optional
Diffstat (limited to 'src')
| -rw-r--r-- | src/lingot-audio-oss.c | 15 | ||||
| -rw-r--r-- | src/lingot-core.c | 2 |
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> |
