Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/usr.bin/midiplay Pull up following revision(s) (requested...
details: https://anonhg.NetBSD.org/src/rev/c4e185269b7d
branches: netbsd-7
changeset: 799243:c4e185269b7d
user: snj <snj%NetBSD.org@localhost>
date: Thu Apr 23 07:03:49 2015 +0000
description:
Pull up following revision(s) (requested by mrg in ticket #717):
usr.bin/midiplay/midiplay.c: revision 1.30
if not playing (-q mode), don't call ioctl() or try to use the results.
now -q mode works.
diffstat:
usr.bin/midiplay/midiplay.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diffs (47 lines):
diff -r 92b97a380511 -r c4e185269b7d usr.bin/midiplay/midiplay.c
--- a/usr.bin/midiplay/midiplay.c Wed Apr 22 07:32:08 2015 +0000
+++ b/usr.bin/midiplay/midiplay.c Thu Apr 23 07:03:49 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: midiplay.c,v 1.29 2011/11/25 01:39:47 jmcneill Exp $ */
+/* $NetBSD: midiplay.c,v 1.29.18.1 2015/04/23 07:03:49 snj Exp $ */
/*
* Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: midiplay.c,v 1.29 2011/11/25 01:39:47 jmcneill Exp $");
+__RCSID("$NetBSD: midiplay.c,v 1.29.18.1 2015/04/23 07:03:49 snj Exp $");
#endif
@@ -404,7 +404,7 @@
/* verify that the requested midi unit exists */
info.device = unit;
- if (ioctl(fd, SEQUENCER_INFO, &info) < 0)
+ if (play && ioctl(fd, SEQUENCER_INFO, &info) < 0)
err(1, "ioctl(SEQUENCER_INFO) failed");
end = buf + tot;
@@ -488,7 +488,9 @@
* in some cases by frobbing tempo and timebase more obscurely, but this
* player is meant to be simple and clear.
*/
- if ((divfmt & 0x80) == 0) {
+ if (!play)
+ /* do nothing */;
+ else if ((divfmt & 0x80) == 0) {
ticks |= divfmt << 8;
if (ioctl(fd, SEQUENCER_TMR_TIMEBASE, &(int){ticks}) < 0)
err(1, "SEQUENCER_TMR_TIMEBASE");
@@ -681,7 +683,7 @@
tp->delta = getvar(tp);
Heapify(tracks, ntrks, 0);
}
- if (ioctl(fd, SEQUENCER_SYNC, 0) < 0)
+ if (play && ioctl(fd, SEQUENCER_SYNC, 0) < 0)
err(1, "SEQUENCER_SYNC");
ret:
Home |
Main Index |
Thread Index |
Old Index