]> git.alsa-project.org Git - alsa-utils.git/commitdiff
detect attempts to play .mid files with amidi
authorClemens Ladisch <clemens@ladisch.de>
Mon, 14 Mar 2005 15:13:48 +0000 (15:13 +0000)
committerClemens Ladisch <clemens@ladisch.de>
Mon, 14 Mar 2005 15:13:48 +0000 (15:13 +0000)
Complain when the user attempts to play .mid files with amidi.

amidi/amidi.c

index 1d5baf6f98cb25a81e18b234b4bec24dea79b69b..9c273552f900638aa3c6628526efeb80d909bd1a 100644 (file)
@@ -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: