Merge "USB MIDI: Fix incorrect timestamps" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
64e171f47c
@@ -379,8 +379,6 @@ public final class UsbDirectMidiDevice implements Closeable {
|
||||
Log.w(TAG, "input thread interrupted");
|
||||
break;
|
||||
}
|
||||
// Record time of event immediately after waking.
|
||||
long timestamp = System.nanoTime();
|
||||
final ByteBuffer byteBuffer = ByteBuffer.wrap(inputBuffer);
|
||||
if (!request.queue(byteBuffer)) {
|
||||
Log.w(TAG, "Cannot queue request");
|
||||
@@ -396,6 +394,9 @@ public final class UsbDirectMidiDevice implements Closeable {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Record time of event after receiving response.
|
||||
long timestamp = System.nanoTime();
|
||||
|
||||
int bytesRead = byteBuffer.position();
|
||||
|
||||
if (bytesRead > 0) {
|
||||
|
||||
Reference in New Issue
Block a user