changeset 12140:9eed12b9b242

netbsd audio support by Bernd Ernesti
author alex
date Tue, 06 Apr 2004 12:23:09 +0000
parents e34f9638aa51
children fd203b7df912
files libmpdemux/tvi_bsdbt848.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/tvi_bsdbt848.c	Tue Apr 06 12:19:40 2004 +0000
+++ b/libmpdemux/tvi_bsdbt848.c	Tue Apr 06 12:23:09 2004 +0000
@@ -571,7 +571,11 @@
 /* Audio Configuration */
 
 priv->dspready = TRUE;
+#ifdef __NetBSD__
+priv->dspdev = strdup("/dev/sound");
+#else
 priv->dspdev = strdup("/dev/dsp");
+#endif
 priv->dspsamplesize = 16;
 priv->dspstereo = 1;
 priv->dspspeed = 44100;
@@ -581,9 +585,9 @@
 priv->dspframesize = priv->dspspeed*priv->dspsamplesize/8/priv->fps * 
                      (priv->dspstereo+1);
 
-if((priv->dspfd = open ("/dev/dsp", O_RDONLY, 0)) < 0)
+if((priv->dspfd = open (priv->dspdev, O_RDONLY, 0)) < 0)
     {
-    perror("/dev/dsp open");
+    perror("dsp open");
     priv->dspready = FALSE;
     } 
 
@@ -601,7 +605,7 @@
    (ioctl(priv->dspfd, SNDCTL_DSP_SPEED, &priv->dspspeed) == -1) ||
    (ioctl(priv->dspfd, SNDCTL_DSP_SETFMT, &priv->dspfmt) == -1)))
     {
-    perror ("configuration of /dev/dsp failed");
+    perror ("configuration of dsp failed");
     close(priv->dspfd);
     priv->dspready = FALSE;
     }