[xiph-cvs] cvs commit: theora/examples player_example.c
Ralph Giles
giles at xiph.org
Wed May 21 11:36:00 PDT 2003
giles 03/05/21 14:36:00
Modified: examples player_example.c
Log:
Use the default path to the OSS audio devices on *BSD. Patch from Jeremy C. Reed.
Revision Changes Path
1.15 +6 -3 theora/examples/player_example.c
Index: player_example.c
===================================================================
RCS file: /usr/local/cvsroot/theora/examples/player_example.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- player_example.c 21 May 2003 10:41:43 -0000 1.14
+++ player_example.c 21 May 2003 18:36:00 -0000 1.15
@@ -12,7 +12,7 @@
function: example SDL player application; plays Ogg Theora files (with
optional Vorbis audio second stream)
- last mod: $Id: player_example.c,v 1.14 2003/05/21 10:41:43 giles Exp $
+ last mod: $Id: player_example.c,v 1.15 2003/05/21 18:36:00 giles Exp $
********************************************************************/
@@ -51,10 +51,13 @@
just a little bit important */
#if defined(__FreeBSD__)
#include <machine/soundcard.h>
+#define AUDIO_DEVICE "/dev/audio"
#elif defined(__NetBSD__) || defined(__OpenBSD__)
#include <soundcard.h>
+#define AUDIO_DEVICE "/dev/audio"
#else
#include <sys/soundcard.h>
+#define AUDIO_DEVICE "/dev/dsp"
#endif
#include <sys/ioctl.h>
@@ -146,9 +149,9 @@
int rate=vi.rate;
int ret;
- audiofd=open("/dev/dsp",O_RDWR);
+ audiofd=open(AUDIO_DEVICE,O_RDWR);
if(audiofd<0){
- fprintf(stderr,"Could not open audio device /dev/dsp.\n");
+ fprintf(stderr,"Could not open audio device " AUDIO_DEVICE ".\n");
exit(1);
}
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list