Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions alsaloop/alsaloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,11 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
break;
case 'c':
err = atoi(optarg);
arg_channels = err >= 1 && err < 1024 ? err : 1;
arg_channels = err >= 1 && err < SND_PCM_LIMIT_HW_CHANNELS_MAX ? err : 1;
break;
case 'r':
err = atoi(optarg);
arg_rate = err >= 4000 && err < 200000 ? err : 44100;
arg_rate = err >= SND_PCM_LIMIT_HW_RATE_MIN && err < SND_PCM_LIMIT_HW_RATE_MAX ? err : 44100;
break;
case 'B':
err = atoi(optarg);
Expand Down
2 changes: 1 addition & 1 deletion aplay/aplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ int main(int argc, char *argv[])
if (tmp < 1000)
tmp *= 1000;
rhwparams.rate = tmp;
if (tmp < 2000 || tmp > 768000) {
if (tmp < SND_PCM_LIMIT_HW_RATE_MIN || tmp > SND_PCM_LIMIT_HW_RATE_MAX) {
error(_("bad speed value %i"), tmp);
return 1;
}
Expand Down
6 changes: 3 additions & 3 deletions speaker-test/speaker-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1123,13 +1123,13 @@ int main(int argc, char *argv[]) {
break;
case 'r':
rate = atoi(optarg);
rate = rate < 4000 ? 4000 : rate;
rate = rate > 768000 ? 768000 : rate;
rate = rate < SND_PCM_LIMIT_SW_RATE_MIN ? SND_PCM_LIMIT_SW_RATE_MIN : rate;
rate = rate > SND_PCM_LIMIT_SW_RATE_MAX ? SND_PCM_LIMIT_SW_RATE_MAX : rate;
break;
case 'c':
channels = atoi(optarg);
channels = channels < 1 ? 1 : channels;
channels = channels > 1024 ? 1024 : channels;
channels = channels > SND_PCM_LIMIT_SW_CHANNELS_MAX ? SND_PCM_LIMIT_SW_CHANNELS_MAX : channels;
break;
case 'f':
freq = atof(optarg);
Expand Down