mirror of
https://github.com/androidx/media.git
synced 2025-05-04 22:20:47 +08:00
Use outputStreamEnded for MetadataRenderer#isEnded
Issue: #8710 PiperOrigin-RevId: 366051836
This commit is contained in:
parent
6d0a04dd87
commit
e8742b33dd
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user