mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pw-cat: improve midi errors
EINVAL for invalid events and file ENOENT for unknown event
This commit is contained in:
parent
8ecef35e80
commit
9bec2e5d8a
2 changed files with 9 additions and 6 deletions
|
|
@ -1031,8 +1031,11 @@ static int setup_midifile(struct data *data)
|
|||
close(data->midi.fd);
|
||||
return -errno;
|
||||
}
|
||||
if ((res = midi_file_init(&data->midi.mf, "r", data->midi.mem, data->midi.st.st_size)) < 0)
|
||||
return -errno;
|
||||
if ((res = midi_file_init(&data->midi.mf, "r", data->midi.mem, data->midi.st.st_size)) < 0) {
|
||||
fprintf(stderr, "error: can't read midi file '%s': %s\n", data->filename, spa_strerror(res));
|
||||
close(data->midi.fd);
|
||||
return res;
|
||||
}
|
||||
|
||||
if (data->verbose)
|
||||
printf("opened file \"%s\" format %08x ntracks:%d div:%d\n",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue