summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJerry Tan <jerry.tan@sun.com>2006-12-08 14:32:51 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2006-12-08 14:32:51 +0000
commit6c58a6baea08b449fec5909d7421c744ab0e65fd (patch)
tree5a08c005bcea897878037655a69d0024dd620be0 /sys
parent6b01538bca460e8a97eb5a7a73a3b76aee61734e (diff)
sys/sunaudio/gstsunaudiosrc.c: Apply patch to open the mixer control and set the MULTIPLE_OPEN ioctl. On solaris, the...
Original commit message from CVS: * sys/sunaudio/gstsunaudiosrc.c: (gst_sunaudiosrc_open): Apply patch to open the mixer control and set the MULTIPLE_OPEN ioctl. On solaris, the mixer device doesn't need opening non-blocking - it can be opened by multiple processes by default, but needs the ioctl for multiple opens within 1 process. Patch by: Jerry Tan <jerry.tan at sun dot com> Fixes: #349015
Diffstat (limited to 'sys')
-rw-r--r--sys/sunaudio/gstsunaudiosrc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/sunaudio/gstsunaudiosrc.c b/sys/sunaudio/gstsunaudiosrc.c
index ffad13721..0993ed979 100644
--- a/sys/sunaudio/gstsunaudiosrc.c
+++ b/sys/sunaudio/gstsunaudiosrc.c
@@ -46,6 +46,7 @@
#include <string.h>
#include <unistd.h>
#include <stropts.h>
+#include <sys/mixer.h>
#include "gstsunaudiosrc.h"
@@ -241,11 +242,12 @@ static gboolean
gst_sunaudiosrc_open (GstAudioSrc * asrc)
{
GstSunAudioSrc *sunaudiosrc = GST_SUNAUDIO_SRC (asrc);
- int fd, ret;
+ int fd, ret, err;
- fd = open (sunaudiosrc->device, O_RDWR | O_NONBLOCK);
+ fd = open (sunaudiosrc->device, O_RDONLY);
+ err = ioctl (fd, AUDIO_MIXER_MULTIPLE_OPEN);
- if (fd == -1) {
+ if (fd == -1 || err == -1) {
GST_ELEMENT_ERROR (sunaudiosrc, RESOURCE, OPEN_READ, (NULL),
("can't open connection to Sun Audio device %s", sunaudiosrc->device));