Attached patch for aplay fixes two off-by-one errors preventing usage
of the last available sample format.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
)
, command);
printf(_("Recognized sample formats are:"));
- for (k = 0; k < SND_PCM_FORMAT_LAST; ++k) {
+ for (k = 0; k <= SND_PCM_FORMAT_LAST; ++k) {
const char *s = snd_pcm_format_name(k);
if (s)
printf(" %s", s);
snd_pcm_format_t format;
fprintf(stderr, "Available formats:\n");
- for (format = 0; format < SND_PCM_FORMAT_LAST; format++) {
+ for (format = 0; format <= SND_PCM_FORMAT_LAST; format++) {
if (snd_pcm_hw_params_test_format(handle, params, format) == 0)
fprintf(stderr, "- %s\n", snd_pcm_format_name(format));
}