Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(649)

Unified Diff: media/midi/midi_manager_mac.cc

Issue 965793002: Web MIDI: MIDI input messages may be lost or cause a crash on OS X (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/midi/midi_manager_mac.cc
diff --git a/media/midi/midi_manager_mac.cc b/media/midi/midi_manager_mac.cc
index 8a9e06073e4052aee58f50e663fa67beba4d2bfa..8a9ece014ed7198f9f07f2d08cded115b97d951a 100644
--- a/media/midi/midi_manager_mac.cc
+++ b/media/midi/midi_manager_mac.cc
@@ -287,16 +287,18 @@ void MidiManagerMac::ReadMidi(MIDIEndpointRef source,
uint32 port_index = source_map_[source];
// Go through each packet and process separately.
+ const MIDIPacket* packet = &packet_list->packet[0];
for (size_t i = 0; i < packet_list->numPackets; i++) {
// Each packet contains MIDI data for one or more messages (like note-on).
- const MIDIPacket &packet = packet_list->packet[i];
- double timestamp_seconds = MIDITimeStampToSeconds(packet.timeStamp);
+ double timestamp_seconds = MIDITimeStampToSeconds(packet->timeStamp);
ReceiveMidiData(
port_index,
- packet.data,
- packet.length,
+ packet->data,
+ packet->length,
timestamp_seconds);
+
+ packet = MIDIPacketNext(packet);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698