Commit f6042d63 by tonihei Committed by Tianyi Feng

Clarify MediaPeriod.readDiscontinuity Javadoc

It currently wrongly documents that it is only called before reading
streams (that has never been the case and all MediaPeriods already need
to handle calls after reading samples from the streams).

It was also a bit unclear what a discontinuity implies and the new
Javadoc calls out the main use case for discontinuties and the intended
meaning of returning a discontinuity.

#minor-release

PiperOrigin-RevId: 543989124
(cherry picked from commit 7530c45cb60f212d9d65c24f40a45fe666416ad5)
parent 7c871443
...@@ -161,14 +161,18 @@ public interface MediaPeriod extends SequenceableLoader { ...@@ -161,14 +161,18 @@ public interface MediaPeriod extends SequenceableLoader {
/** /**
* Attempts to read a discontinuity. * Attempts to read a discontinuity.
* *
* <p>A discontinuity implies that the provided {@link SampleStream SampleStreams} will start from
* a new playback position and any output pipelines need to be reset. This happens for example if
* the streams provide decode-only samples before the intended playback start position that need
* to be dropped.
*
* <p>After this method has returned a value other than {@link C#TIME_UNSET}, all {@link * <p>After this method has returned a value other than {@link C#TIME_UNSET}, all {@link
* SampleStream}s provided by the period are guaranteed to start from a key frame. * SampleStream SampleStreams} provided by the period are guaranteed to start from a key frame.
* *
* <p>This method is only called after the period has been prepared and before reading from any * <p>This method is only called after the period has been prepared.
* {@link SampleStream}s provided by the period.
* *
* @return If a discontinuity was read then the playback position in microseconds after the * @return The playback position after the discontinuity, in microseconds, or {@link C#TIME_UNSET}
* discontinuity. Else {@link C#TIME_UNSET}. * if there is no discontinuity.
*/ */
long readDiscontinuity(); long readDiscontinuity();
......
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