[SCM] hydrogen/master: Fix off-by-one error in JACK MIDI.
alessio at users.alioth.debian.org
alessio at users.alioth.debian.org
Tue Jun 12 11:19:14 UTC 2012
The following commit has been merged in the master branch:
commit f9b679f4516a8588afd6ed305c7026a50566b396
Author: Alessio Treglia <alessio at debian.org>
Date: Tue Jun 12 11:43:16 2012 +0200
Fix off-by-one error in JACK MIDI.
Closes: #661725
Thanks: Roland Mas for the patch!
diff --git a/debian/patches/1007_off_by_one_in_jackmidi.patch b/debian/patches/1007_off_by_one_in_jackmidi.patch
new file mode 100644
index 0000000..e09957a
--- /dev/null
+++ b/debian/patches/1007_off_by_one_in_jackmidi.patch
@@ -0,0 +1,39 @@
+Description: Fix off-by-one error in JACK MIDI
+ Fixed bug whereby a MIDI event is only sent when there is another
+ one queued.
+Author: Roland Mas <lolando at debian.org>
+Bug-Debian: http://bugs.debian.org/661725
+---
+ src/core/src/IO/jack_midi_driver.cpp | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+--- hydrogen.orig/src/core/src/IO/jack_midi_driver.cpp
++++ hydrogen/src/core/src/IO/jack_midi_driver.cpp
+@@ -234,11 +234,12 @@ JackMidiDriver::JackMidiRead(jack_nframe
+ if (buffer == NULL)
+ break;
+
+- memcpy(buffer, jack_buffer + (4 * rx_in_pos) + 1, len);
+ t++;
+ rx_in_pos++;
+ if (rx_in_pos >= JACK_MIDI_BUFFER_MAX)
+ rx_in_pos = 0;
++
++ memcpy(buffer, jack_buffer + (4 * rx_in_pos) + 1, len);
+ }
+ unlock();
+ }
+@@ -394,6 +395,13 @@ void JackMidiDriver::handleQueueNote(Not
+ if (vel < 0 || vel > 127)
+ return;
+
++ buffer[0] = 0x80 | channel; /* note off */
++ buffer[1] = key;
++ buffer[2] = 0;
++ buffer[3] = 0;
++
++ JackMidiOutEvent(buffer, 3);
++
+ buffer[0] = 0x90 | channel; /* note on */
+ buffer[1] = key;
+ buffer[2] = vel;
diff --git a/debian/patches/series b/debian/patches/series
index cf33343..42698ec 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@
1005_name_shouldnt_repeat_genericname.patch
1006_porttime.patch
ftbfs-gcc-4.7.diff
+1007_off_by_one_in_jackmidi.patch
--
hydrogen packaging
More information about the pkg-multimedia-commits
mailing list