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

Unified Diff: media/midi/midi_message_queue.cc

Issue 949683002: Web MIDI: running status should be reset on receiving a system message (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 | media/midi/midi_message_queue_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/midi/midi_message_queue.cc
diff --git a/media/midi/midi_message_queue.cc b/media/midi/midi_message_queue.cc
index 8011136c1bce252446aac899f9f83eb4772b2118..cba2c6932fe7b0afde7be168d2c06e96854243e4 100644
--- a/media/midi/midi_message_queue.cc
+++ b/media/midi/midi_message_queue.cc
@@ -27,6 +27,10 @@ bool IsSystemRealTimeMessage(uint8 data) {
return 0xf8 <= data;
}
+bool IsSystemMessage(uint8 data) {
+ return 0xf0 <= data;
+}
+
} // namespace
MidiMessageQueue::MidiMessageQueue(bool allow_running_status)
@@ -104,9 +108,10 @@ void MidiMessageQueue::Get(std::vector<uint8>* message) {
if (next_message_.size() == target_len) {
std::swap(*message, next_message_);
next_message_.clear();
- if (allow_running_status_) {
+ if (allow_running_status_ && !IsSystemMessage(status_byte)) {
// Speculatively keep the status byte in case of running status. If this
// assumption is not true, |next_message_| will be cleared anyway.
+ // Note that system common messages should reset the running status.
next_message_.push_back(status_byte);
}
return;
« no previous file with comments | « no previous file | media/midi/midi_message_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698