From: Clemens Ladisch Date: Mon, 14 Mar 2005 15:13:48 +0000 (+0000) Subject: detect attempts to play .mid files with amidi X-Git-Tag: v1.0.9rc2~4 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=556364bbaf34625089d6eba561951943758b33a0;p=alsa-utils.git detect attempts to play .mid files with amidi Complain when the user attempts to play .mid files with amidi. --- diff --git a/amidi/amidi.c b/amidi/amidi.c index 1d5baf6..9c27355 100644 --- a/amidi/amidi.c +++ b/amidi/amidi.c @@ -241,6 +241,10 @@ static void load_file(void) error("cannot read from %s: %s", send_file_name, strerror(errno)); goto _error; } + if (length >= 4 && !memcmp(send_data, "MThd", 4)) { + error("%s is a Standard MIDI File; use aplaymidi to send it", send_file_name); + goto _error; + } send_data_length = length; goto _exit; _error: