/** * Wait until all the frames from the frame buffer have been consumed. Keeps the buffering thread alive to keep it * interruptible for seeking until buffer is empty. * * @throws InterruptedException When interrupted externally (or for seek/stop). */ public void waitOnEnd() throws InterruptedException { frameBuffer.setTerminateOnEmpty(); frameBuffer.waitForTermination(); }