- /* defaults */
- pad->samplerate = conf->samplerate_arg;
- pad->channels = conf->channels_arg;
- if (!conf->samplerate_given) { /* config option trumps btr_exec */
- int32_t rate;
- if (get_btr_samplerate(btrn, &rate) >= 0)
- pad->samplerate = rate;
- }
- if (!conf->channels_given) {
- int32_t ch;
- if (get_btr_channels(btrn, &ch) >= 0)
- pad->channels = ch;
- }
- PARA_INFO_LOG("%d channel(s), %dHz\n", pad->channels, pad->samplerate);
+ pad = para_calloc(sizeof(*pad));
+ get_btr_sample_rate(btrn, &val);
+ pad->sample_rate = val;
+ get_btr_channels(btrn, &val);
+ pad->channels = val;
+ get_btr_sample_format(btrn, &val);
+ pad->sample_format = get_alsa_pcm_format(val);
+
+ PARA_INFO_LOG("%d channel(s), %dHz\n", pad->channels,
+ pad->sample_rate);