- /* Hmmm, let's 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 through an input callback
- * AND you want the DefaultOutputUnit to do any format conversions
- * necessary from your format to the device's format.
+ 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;
+ }
+ /*
+ * 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
+ * through an input callback AND you want the DefaultOutputUnit to do
+ * any format conversions necessary from your format to the device's
+ * format.