aboutsummaryrefslogtreecommitdiff
path: root/ossmixer.c
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2009-06-04 23:48:45 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2009-06-04 23:48:45 +0000
commit0d61927687a61812889d190f706b04f705e432a5 (patch)
tree4b39616e45f38acca312c467df84477ee8ce6e8a /ossmixer.c
parent116783794ea3af6318bde312505ee10e1ad46eb7 (diff)
fixed another memory allocation bug and set the default to /dev/mixer since that's the dev that all modern Linux's have
svn path=/trunk/externals/ext13/; revision=11671
Diffstat (limited to 'ossmixer.c')
-rw-r--r--ossmixer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ossmixer.c b/ossmixer.c
index 7617dce..8fbf7a9 100644
--- a/ossmixer.c
+++ b/ossmixer.c
@@ -40,15 +40,15 @@ static void *ossmixer_new(t_floatarg f)
outlet_new(&x->x_obj, &s_bang);
x->x_out1 = outlet_new(&x->x_obj, &s_symbol);
sprintf(devicename,"/dev/mixer%d",(int)f);
- x->device = gensym(devicename);
-/* x->device = gensym ("/dev/mixer");*/
+// x->device = gensym(devicename);
+ x->device = gensym ("/dev/mixer");
fd = open(x->device->s_name, O_WRONLY);
if (fd < 0){
post ("ossmixer: could not open %s",x->device->s_name);
x->device = gensym("/dev/mixer");
close (fd);
}else{
- post ("ossmixer: device set to %s",devicename);
+ post ("ossmixer: device set to %s",x->device->s_name);
}
close(fd);
return (x);
@@ -56,7 +56,7 @@ static void *ossmixer_new(t_floatarg f)
static void ossmixer_set_device(t_ossmixer *x, t_floatarg f)
{
- char* devicename;
+ char devicename[FILENAME_MAX];
int fd = -1;
sprintf(devicename,"/dev/mixer%d",(int)f);
x->device = gensym(devicename);