Commit e8742b33 by ibaker Committed by marcbaechinger

Use outputStreamEnded for MetadataRenderer#isEnded

Issue: #8710
PiperOrigin-RevId: 366051836
parent 6d0a04dd
......@@ -77,6 +77,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
......
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