Commit 45b51d26 by andrewlewis Committed by Tofunmi Adigun-Hameed

Signal end-of-stream after creating latch

The output end-of-stream notification from the last shader could theoretically
arrive before the latch for detecting it is created, which might cause waiting
on the latch indefinitely. Create the latch before signaling end of stream so
that it's guaranteed to be set before the end-of-stream signal arrives.

PiperOrigin-RevId: 532056472
(cherry picked from commit 53c379cb98874c7697965a82fbd2aa29063a238b)
parent 95bd42d0
...@@ -372,9 +372,9 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor { ...@@ -372,9 +372,9 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
} }
} }
checkNotNull(textureManager).signalEndOfCurrentInputStream();
// Wait until the current input stream is processed before continuing to the next input. // Wait until the current input stream is processed before continuing to the next input.
latch = new CountDownLatch(1); latch = new CountDownLatch(1);
checkNotNull(textureManager).signalEndOfCurrentInputStream();
try { try {
latch.await(); latch.await();
} catch (InterruptedException e) { } catch (InterruptedException e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment