[PATCH alsa-utils 03/10] aplaymidi: Allow to pass 0 to -u option, too

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Specifying -u 0 shouldn't be treated as an error but it should mean
the legacy MIDI 1.0 handling.

Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
---
 seq/aplaymidi/aplaymidi.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/seq/aplaymidi/aplaymidi.c b/seq/aplaymidi/aplaymidi.c
index dd8d07997985..7aeea824ce0d 100644
--- a/seq/aplaymidi/aplaymidi.c
+++ b/seq/aplaymidi/aplaymidi.c
@@ -996,11 +996,9 @@ int main(int argc, char *argv[])
 			end_delay = atoi(optarg);
 			break;
 		case 'u':
-			if (strcmp(optarg, "1")) {
-				errormsg("Only MIDI 1.0 is supported");
-				return 1;
-			}
-			ump_mode = 1;
+			ump_mode = atoi(optarg);
+			if (ump_mode < 0 || ump_mode > 1)
+				fatal("Only MIDI 1.0 is supported");
 			break;
 		default:
 			usage(argv[0]);
-- 
2.43.0




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux