mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +00:00
Release subtitle outputBuffer after decoding.
PiperOrigin-RevId: 391509443
This commit is contained in:
parent
dfb9ac11e9
commit
afc549fba4
1 changed files with 3 additions and 2 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue