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

Commit 8f5228af authored by Phil Burk's avatar Phil Burk Committed by Android (Google) Code Review
Browse files

Merge "UsbMidiDevice: add timestamps for input events" into mnc-dev

parents 2f1a08e6 6456a65a
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);
                                }
                            }
                        }