# HG changeset patch # User albeu # Date 1131613376 0 # Node ID 832a93fc5debec06e27d8e0a6f97bb1d3ba2ccd0 # Parent 3ff863e54b93af68e211694a2c1b86e567de5ab4 Allow setting the mixer per instance so one can fallback between several oos device and still have correct mixer settings all the time. The sytax is now: oss[:dsp_device[:mixer_device[:mixer_channel]]] diff -r 3ff863e54b93 -r 832a93fc5deb libao2/ao_oss.c --- a/libao2/ao_oss.c Thu Nov 10 02:39:31 2005 +0000 +++ b/libao2/ao_oss.c Thu Nov 10 09:02:56 2005 +0000 @@ -215,17 +215,32 @@ static int init(int rate,int channels,int format,int flags){ char *mixer_channels [SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES; int oss_format; + char *mdev = mixer_device, *mchan = mixer_channel; mp_msg(MSGT_AO,MSGL_V,"ao2: %d Hz %d chans %s\n",rate,channels, af_fmt2str_short(format)); - if (ao_subdevice) + if (ao_subdevice) { + char *m,*c; + m = strchr(ao_subdevice,':'); + if(m) { + c = strchr(m+1,':'); + if(c) { + mchan = c+1; + c[0] = '\0'; + } + mdev = m+1; + m[0] = '\0'; + } dsp = ao_subdevice; + } - if(mixer_device) - oss_mixer_device=mixer_device; - - if(mixer_channel){ + if(mdev) + oss_mixer_device=mdev; + else + oss_mixer_device=PATH_DEV_MIXER; + + if(mchan){ int fd, devs, i; if ((fd = open(oss_mixer_device, O_RDONLY)) == -1){ @@ -236,10 +251,9 @@ close(fd); for (i=0; i