Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/virtual_oss/virtual_oss/main.c
| Show First 20 Lines • Show All 2,222 Lines • ▼ Show 20 Lines | case 'R': | ||||
| } | } | ||||
| break; | break; | ||||
| case 'w': | case 'w': | ||||
| if (strlen(optarg) > VMAX_STRING - 1) | if (strlen(optarg) > VMAX_STRING - 1) | ||||
| return ("Device name too long"); | return ("Device name too long"); | ||||
| strncpy(profile.wav_name, optarg, sizeof(profile.wav_name)); | strncpy(profile.wav_name, optarg, sizeof(profile.wav_name)); | ||||
| break; | break; | ||||
| case 'd': | case 'd': | ||||
| if (strlen(optarg) > VMAX_STRING - 1) | |||||
| return ("Device name too long"); | |||||
| strncpy(profile.oss_name, optarg, sizeof(profile.oss_name)); | |||||
| if (profile.bits == 0 || voss_dsp_sample_rate == 0 || | |||||
| profile.channels == 0 || voss_dsp_samples == 0) | |||||
| return ("Missing -b, -r, -c or -s parameters"); | |||||
| val = (voss_dsp_samples * | |||||
| profile.bits * profile.channels) / 8; | |||||
| if (val <= 0 || val >= (1024 * 1024)) | |||||
| return ("-s option value is too big"); | |||||
| ptr = dup_profile(&profile, opt_amp, opt_pol, | |||||
| opt_mute[0], opt_mute[1], 0, 1); | |||||
| if (ptr != NULL) | |||||
| return (ptr); | |||||
| break; | |||||
| case 'L': | case 'L': | ||||
| case 'l': | case 'l': | ||||
| if (strlen(optarg) > VMAX_STRING - 1) | if (strlen(optarg) > VMAX_STRING - 1) | ||||
| return ("Device name too long"); | return ("Device name too long"); | ||||
| strncpy(profile.oss_name, optarg, sizeof(profile.oss_name)); | strncpy(profile.oss_name, optarg, sizeof(profile.oss_name)); | ||||
| if (profile.bits == 0 || voss_dsp_sample_rate == 0 || | if (profile.bits == 0 || voss_dsp_sample_rate == 0 || | ||||
| profile.channels == 0 || voss_dsp_samples == 0) | profile.channels == 0 || voss_dsp_samples == 0) | ||||
| return ("Missing -b, -r, -r or -s parameters"); | return ("Missing -b, -r, -c or -s parameters"); | ||||
| val = (voss_dsp_samples * | val = (voss_dsp_samples * | ||||
| profile.bits * profile.channels) / 8; | profile.bits * profile.channels) / 8; | ||||
| if (val <= 0 || val >= (1024 * 1024)) | if (val <= 0 || val >= (1024 * 1024)) | ||||
| return ("-s option value is too big"); | return ("-s option value is too big"); | ||||
| ptr = dup_profile(&profile, opt_amp, opt_pol, | ptr = dup_profile(&profile, opt_amp, opt_pol, | ||||
| opt_mute[0], opt_mute[1], c == 'L', 0); | opt_mute[0], opt_mute[1], c == 'L', c == 'd'); | ||||
| if (ptr != NULL) | if (ptr != NULL) | ||||
| return (ptr); | return (ptr); | ||||
| break; | break; | ||||
| case 'S': | case 'S': | ||||
| voss_libsamplerate_enable = 1; | voss_libsamplerate_enable = 1; | ||||
markj: What is the difference between `-d` and `-l`? | |||||
Not Done Inline ActionsOh, I see, it's the last parameter to dup_profile(). Then you can collapse the calls: ptr = dup_profile(&profile, opt_amp, opt_pol, opt_mute[0], opt_mute[1], c == 'L', c == 'd'); markj: Oh, I see, it's the last parameter to dup_profile(). Then you can collapse the calls:
```
ptr… | |||||
| break; | break; | ||||
| case 'Q': | case 'Q': | ||||
| c = atoi(optarg); | c = atoi(optarg); | ||||
| switch (c) { | switch (c) { | ||||
| case 0: | case 0: | ||||
| voss_libsamplerate_quality = SRC_SINC_BEST_QUALITY; | voss_libsamplerate_quality = SRC_SINC_BEST_QUALITY; | ||||
| break; | break; | ||||
| case 1: | case 1: | ||||
| ▲ Show 20 Lines • Show All 375 Lines • Show Last 20 Lines | |||||
What is the difference between -d and -l?