/** the post_select writes audio data here */
struct osx_buffer *to;
/** sample rate of the current audio stream */
- unsigned samplerate;
+ unsigned sample_rate;
/** number of channels of the current audio stream */
unsigned channels;
};
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->samplerate = conf->samplerate_arg;
- powd->channels = conf->channels_arg;
- if (!conf->samplerate_given) {
- int32_t rate;
- if (get_btr_samplerate(btrn, &rate) >= 0)
- powd->samplerate = rate;
- }
- if (!conf->channels_given) {
- int32_t ch;
- if (get_btr_channels(btrn, &ch) >= 0)
- powd->channels = ch;
- }
+ get_btr_sample_rate(btrn, &val);
+ powd->sample_rate = val;
+ get_btr_channels(btrn, &val);
+ 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
* any format conversions necessary from your format to the device's
* format.
*/
- format.mSampleRate = powd->samplerate;
+ format.mSampleRate = powd->sample_rate;
/* The specific encoding type of audio stream */
format.mFormatID = kAudioFormatLinearPCM;
/* flags specific to each format */
sched_min_delay(s);
if (ret <= 0 || numbytes < wn->min_iqs)
return;
- divisor = powd->samplerate * wn->min_iqs / numbytes;
+ divisor = powd->sample_rate * wn->min_iqs / numbytes;
if (divisor)
tv_divide(divisor, &tmp, &delay);
sched_request_timeout(&delay, s);