Fix the renderer thread causing NvConnection.stop() to block forever. Remove the hack to workaround this bug.

This commit is contained in:
Cameron Gutman
2013-12-12 17:45:03 -05:00
parent e9a4b82267
commit 31cac7f6a2
2 changed files with 9 additions and 7 deletions

View File

@@ -72,12 +72,15 @@ public class SwingCpuDecoderRenderer implements VideoDecoderRenderer {
{
long diff = nextFrameTime - System.currentTimeMillis();
if (diff > WAIT_CEILING_MS) {
try {
Thread.sleep(diff);
} catch (InterruptedException e) {
return;
}
if (diff < WAIT_CEILING_MS) {
// We must call Thread.sleep in order to be interruptable
diff = 0;
}
try {
Thread.sleep(diff);
} catch (InterruptedException e) {
return;
}
nextFrameTime = computePresentationTimeMs(targetFps);

View File

@@ -40,7 +40,6 @@ public class KeyboardHandler implements KeyListener {
event.getKeyCode() == KeyEvent.VK_Q) {
System.out.println("quitting");
parent.close();
System.exit(0);
}
translator.sendKeyDown(keyMap, modifier);