mirror of
https://github.com/samsonjs/media.git
synced 2026-04-12 12:25:47 +00:00
Fixed issue with TextRenderer and RawCC 608/708 captions in which all the captions prior to the playback position would be rendered in [] succession when a VOD stream starts.
Instead of clearing the DECODE_ONLY flag for all input buffers in TextRenderer (i.e. for all caption types), we now only clear it on the output buffer in SimpleSubtitleDecoder. The number if input buffers in CeaDecoder has also been increased to reduce the delay before captions appear for playback sessions that start far ahead into the content. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=146028680
This commit is contained in:
parent
6a844ebce4
commit
87e790f44d
3 changed files with 10 additions and 3 deletions
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
package com.google.android.exoplayer2.text;
|
||||
|
||||
import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.decoder.SimpleDecoder;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
|
|
@ -68,6 +69,8 @@ public abstract class SimpleSubtitleDecoder extends
|
|||
ByteBuffer inputData = inputBuffer.data;
|
||||
Subtitle subtitle = decode(inputData.array(), inputData.limit());
|
||||
outputBuffer.setContent(inputBuffer.timeUs, subtitle, inputBuffer.subsampleOffsetUs);
|
||||
// Clear BUFFER_FLAG_DECODE_ONLY (see [Internal: b/27893809]).
|
||||
outputBuffer.clearFlag(C.BUFFER_FLAG_DECODE_ONLY);
|
||||
return null;
|
||||
} catch (SubtitleDecoderException e) {
|
||||
return e;
|
||||
|
|
|
|||
|
|
@ -191,8 +191,6 @@ public final class TextRenderer extends BaseRenderer implements Callback {
|
|||
// Try and read the next subtitle from the source.
|
||||
int result = readSource(formatHolder, nextInputBuffer);
|
||||
if (result == C.RESULT_BUFFER_READ) {
|
||||
// Clear BUFFER_FLAG_DECODE_ONLY (see [Internal: b/27893809]) and queue the buffer.
|
||||
nextInputBuffer.clearFlag(C.BUFFER_FLAG_DECODE_ONLY);
|
||||
if (nextInputBuffer.isEndOfStream()) {
|
||||
inputStreamEnded = true;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,13 @@ import java.util.TreeSet;
|
|||
public void queueInputBuffer(SubtitleInputBuffer inputBuffer) throws SubtitleDecoderException {
|
||||
Assertions.checkArgument(inputBuffer != null);
|
||||
Assertions.checkArgument(inputBuffer == dequeuedInputBuffer);
|
||||
queuedInputBuffers.add(inputBuffer);
|
||||
if (inputBuffer.isDecodeOnly()) {
|
||||
// We can drop this buffer early (i.e. before it would be decoded) as the CEA formats allow
|
||||
// for decoding to begin mid-stream.
|
||||
releaseInputBuffer(inputBuffer);
|
||||
} else {
|
||||
queuedInputBuffers.add(inputBuffer);
|
||||
}
|
||||
dequeuedInputBuffer = null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue