Commit afc549fb by apodob Committed by bachinger

Release subtitle outputBuffer after decoding.

PiperOrigin-RevId: 391509443
parent dfb9ac11
......@@ -181,8 +181,8 @@ public class SubtitleExtractor implements Extractor {
try {
@Nullable SubtitleInputBuffer inputBuffer = subtitleDecoder.dequeueInputBuffer();
while (inputBuffer == null) {
inputBuffer = subtitleDecoder.dequeueInputBuffer();
Thread.sleep(5);
inputBuffer = subtitleDecoder.dequeueInputBuffer();
}
inputBuffer.ensureSpaceForWrite(bytesRead);
inputBuffer.data.put(subtitleData.getData(), /* offset= */ 0, bytesRead);
......@@ -200,8 +200,8 @@ public class SubtitleExtractor implements Extractor {
try {
@Nullable SubtitleOutputBuffer outputBuffer = subtitleDecoder.dequeueOutputBuffer();
while (outputBuffer == null) {
outputBuffer = subtitleDecoder.dequeueOutputBuffer();
Thread.sleep(5);
outputBuffer = subtitleDecoder.dequeueOutputBuffer();
}
for (int i = 0; i < outputBuffer.getEventTimeCount(); i++) {
......@@ -215,6 +215,7 @@ public class SubtitleExtractor implements Extractor {
/* offset= */ 0,
/* cryptoData= */ null);
}
outputBuffer.release();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new InterruptedIOException();
......
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