Commit af926deb by ibaker Committed by Oliver Woodman

Use outputStreamEnded for MetadataRenderer#isEnded

Issue: #8710
#minor-release
PiperOrigin-RevId: 366051836
parent a7d7cfd0
......@@ -102,6 +102,9 @@
spec ([#8704](https://github.com/google/ExoPlayer/issues/8704)).
* Support TTML `textEmphasis` attributes, used for Japanese boutens.
* Support TTML `shear` attributes.
* Metadata:
* Ensure that timed metadata near the end of a period is not dropped
([#8710](https://github.com/google/ExoPlayer/issues/8710)).
* MediaSession extension: Remove dependency to core module and rely on common
only. The `TimelineQueueEditor` uses a new `MediaDescriptionConverter` for
this purpose and does not rely on the `ConcatenatingMediaSource` anymore.
......
......@@ -58,6 +58,7 @@ public final class MetadataRenderer extends BaseRenderer implements Callback {
private int pendingMetadataCount;
@Nullable private MetadataDecoder decoder;
private boolean inputStreamEnded;
private boolean outputStreamEnded;
private long subsampleOffsetUs;
/**
......@@ -118,6 +119,7 @@ public final class MetadataRenderer extends BaseRenderer implements Callback {
protected void onPositionReset(long positionUs, boolean joining) {
flushPendingMetadata();
inputStreamEnded = false;
outputStreamEnded = false;
}
@Override
......@@ -158,6 +160,9 @@ public final class MetadataRenderer extends BaseRenderer implements Callback {
pendingMetadataIndex = (pendingMetadataIndex + 1) % MAX_PENDING_METADATA_COUNT;
pendingMetadataCount--;
}
if (inputStreamEnded && pendingMetadataCount == 0) {
outputStreamEnded = true;
}
}
/**
......@@ -198,7 +203,7 @@ public final class MetadataRenderer extends BaseRenderer implements Callback {
@Override
public boolean isEnded() {
return inputStreamEnded;
return outputStreamEnded;
}
@Override
......
......@@ -92,3 +92,8 @@ MediaCodecAdapter (exotest.audio.aac):
buffers[89] = length 229, hash FFF98DF0
buffers[90] = length 6, hash 31B22286
buffers[91] = length 0, hash 1
MetadataOutput:
Metadata[0]:
entry[0] = EMSG: scheme=urn:mpeg:dash:event:callback:2015, id=0, durationMs=1000, value=1
Metadata[1]:
entry[0] = EMSG: scheme=urn:mpeg:dash:event:callback:2015, id=1, durationMs=1000, value=1
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