Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed839f59 authored by Phil Burk's avatar Phil Burk Committed by Android Git Automerger
Browse files

am e2823cb3: am 8f5228af: Merge "UsbMidiDevice: add timestamps for input events" into mnc-dev

* commit 'e2823cb3':
  UsbMidiDevice: add timestamps for input events
parents 42d2aaa0 e2823cb3
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -203,6 +203,8 @@ public final class UsbMidiDevice implements Closeable {
                byte[] buffer = new byte[BUFFER_SIZE];
                try {
                    while (true) {
                        // Record time of event immediately after waking.
                        long timestamp = System.nanoTime();
                        synchronized (mLock) {
                            if (!mIsOpen) break;

@@ -222,7 +224,7 @@ public final class UsbMidiDevice implements Closeable {
                                    }

                                    int count = mInputStreams[index].read(buffer);
                                    outputReceivers[index].send(buffer, 0, count);
                                    outputReceivers[index].send(buffer, 0, count, timestamp);
                                }
                            }
                        }