diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2013-07-30 21:19:33 +1000 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2013-07-31 18:32:18 +1000 |
commit | e5e6ff5a0d2cedb49c3ce9a09c0532ec2c4c1ab2 (patch) | |
tree | 3e1a4f1fb49c0630c3caf9ea20f953c643ac00e3 /programs | |
parent | 040d7fd5c8ed3fad8436b735e2c1aee1b751191e (diff) |
programs/sndfile-play.c : Special case for Android.
Actual playback is not supported but at least it now compiles for Android.
Diffstat (limited to 'programs')
-rw-r--r-- | programs/sndfile-play.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/programs/sndfile-play.c b/programs/sndfile-play.c index 393df97..f779f11 100644 --- a/programs/sndfile-play.c +++ b/programs/sndfile-play.c @@ -1,5 +1,5 @@ /* -** Copyright (C) 1999-2012 Erik de Castro Lopo <erikd@mega-nerd.com> +** Copyright (C) 1999-2013 Erik de Castro Lopo <erikd@mega-nerd.com> ** ** All rights reserved. ** @@ -52,7 +52,9 @@ #include <sys/time.h> #endif -#if defined (__linux__) || defined (__FreeBSD_kernel__) || defined (__FreeBSD__) +#if defined (__ANDROID__) + +#elif defined (__linux__) || defined (__FreeBSD_kernel__) || defined (__FreeBSD__) #include <fcntl.h> #include <sys/ioctl.h> #include <sys/soundcard.h> @@ -362,7 +364,7 @@ alsa_write_float (snd_pcm_t *alsa_dev, float *data, int frames, int channels) ** Linux/OSS functions for playing a sound. */ -#if defined (__linux__) || defined (__FreeBSD_kernel__) || defined (__FreeBSD__) +#if !defined (__ANDROID__) && (defined (__linux__) || defined (__FreeBSD_kernel__) || defined (__FreeBSD__)) static int opensoundsys_open_device (int channels, int srate) ; @@ -1169,7 +1171,11 @@ main (int argc, char *argv []) return 1 ; } ; -#if defined (__linux__) +#if defined (__ANDROID__) + puts ("*** Playing sound not yet supported on Android.") ; + puts ("*** Please feel free to submit a patch.") ; + return 1 ; +#elif defined (__linux__) #if HAVE_ALSA_ASOUNDLIB_H if (access ("/proc/asound/cards", R_OK) == 0) alsa_play (argc, argv) ; |