mirror of
https://github.com/samsonjs/media.git
synced 2026-03-25 09:25:53 +00:00
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 857e6ebee8)
This commit is contained in:
parent
7e30091196
commit
b0f8a8f316
1 changed files with 1 additions and 1 deletions
|
|
@ -374,9 +374,9 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
|
|||
}
|
||||
}
|
||||
|
||||
checkNotNull(textureManager).signalEndOfCurrentInputStream();
|
||||
// Wait until the current input stream is processed before continuing to the next input.
|
||||
latch = new CountDownLatch(1);
|
||||
checkNotNull(textureManager).signalEndOfCurrentInputStream();
|
||||
try {
|
||||
latch.await();
|
||||
} catch (InterruptedException e) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue