- ret = -ERRNO_TO_PARA_ERROR(EINVAL);
- val = conf->channels_arg;
- given = conf->channels_given;
- if (val < 0 || (val == 0 && given))
- goto err;
- val = conf->sample_rate_arg;
- given = conf->sample_rate_given;
- if (val < 0 || (val == 0 && given))
- goto err;
- val = conf->dest_sample_rate_arg;
- given = conf->dest_sample_rate_given;
- if (val < 0 || (val == 0 && given))
- goto err;
- *config = conf;
- return 1;
-err:
- free(conf);
- return ret;
+ u32 = U32_OPTVAL(CHANNELS, lpr);
+ given = OPT_GIVEN(CHANNELS, lpr);
+ if (u32 == 0 && given) {
+ PARA_EMERG_LOG("fatal: zero channels?!\n");
+ exit(EXIT_FAILURE);
+ }
+ u32 = U32_OPTVAL(SAMPLE_RATE, lpr);
+ given = OPT_GIVEN(SAMPLE_RATE, lpr);
+ if (u32 == 0 && given) {
+ PARA_EMERG_LOG("fatal: input sample rate can not be 0\n");
+ exit(EXIT_FAILURE);
+ }
+ u32 = U32_OPTVAL(DEST_SAMPLE_RATE, lpr);
+ given = OPT_GIVEN(DEST_SAMPLE_RATE, lpr);
+ if (u32 == 0 && given) {
+ PARA_EMERG_LOG("fatal: destination sample rate can not be 0\n");
+ exit(EXIT_FAILURE);
+ }
+ return NULL;