AudioStreamBasicDescription format;
int ret;
struct btr_node *btrn = wn->btrn;
- struct osx_write_args_info *conf = wn->conf;
+ int32_t val;
wn->private_data = powd;
/* where did that default audio output go? */
if (AudioUnitInitialize(powd->audio_unit))
goto e1;
powd->play = 0;
- powd->sample_rate = conf->sample_rate_arg;
- powd->channels = conf->channels_arg;
- if (!conf->sample_rate_given) {
- int32_t rate;
- get_btr_sample_rate(btrn, &rate);
- powd->sample_rate = rate;
- }
- if (!conf->channels_given) {
- int32_t ch;
- get_btr_channels(btrn, &ch);
- powd->channels = ch;
- }
+ ret = get_btr_sample_rate(btrn, &val);
+ if (ret < 0)
+ goto e1;
+ powd->sample_rate = val;
+ ret = get_btr_channels(btrn, &val);
+ if (ret < 0)
+ goto e1;
+ powd->channels = val;
/*
* Choose PCM format. We tell the Output Unit what format we're going
* to supply data to it. This is necessary if you're providing data