Explicitly support MediaChunk.chunkIndex = C.INDEX_UNSET. This is common in
Manifestless streams. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=198445216
This commit is contained in:
parent
25f4ee22d6
commit
3639f1281a
@ -44,7 +44,7 @@ public abstract class BaseMediaChunk extends MediaChunk {
|
|||||||
* @param endTimeUs The end time of the media contained by the chunk, in microseconds.
|
* @param endTimeUs The end time of the media contained by the chunk, in microseconds.
|
||||||
* @param seekTimeUs The media time from which output will begin, or {@link C#TIME_UNSET} if the
|
* @param seekTimeUs The media time from which output will begin, or {@link C#TIME_UNSET} if the
|
||||||
* whole chunk should be output.
|
* whole chunk should be output.
|
||||||
* @param chunkIndex The index of the chunk.
|
* @param chunkIndex The index of the chunk, or {@link C#INDEX_UNSET} if it is not known.
|
||||||
*/
|
*/
|
||||||
public BaseMediaChunk(
|
public BaseMediaChunk(
|
||||||
DataSource dataSource,
|
DataSource dataSource,
|
||||||
|
@ -49,7 +49,7 @@ public class ContainerMediaChunk extends BaseMediaChunk {
|
|||||||
* @param endTimeUs The end time of the media contained by the chunk, in microseconds.
|
* @param endTimeUs The end time of the media contained by the chunk, in microseconds.
|
||||||
* @param seekTimeUs The media time from which output will begin, or {@link C#TIME_UNSET} if the
|
* @param seekTimeUs The media time from which output will begin, or {@link C#TIME_UNSET} if the
|
||||||
* whole chunk should be output.
|
* whole chunk should be output.
|
||||||
* @param chunkIndex The index of the chunk.
|
* @param chunkIndex The index of the chunk, or {@link C#INDEX_UNSET} if it is not known.
|
||||||
* @param chunkCount The number of chunks in the underlying media that are spanned by this
|
* @param chunkCount The number of chunks in the underlying media that are spanned by this
|
||||||
* instance. Normally equal to one, but may be larger if multiple chunks as defined by the
|
* instance. Normally equal to one, but may be larger if multiple chunks as defined by the
|
||||||
* underlying media are being merged into a single load.
|
* underlying media are being merged into a single load.
|
||||||
|
@ -26,7 +26,7 @@ import com.google.android.exoplayer2.util.Assertions;
|
|||||||
*/
|
*/
|
||||||
public abstract class MediaChunk extends Chunk {
|
public abstract class MediaChunk extends Chunk {
|
||||||
|
|
||||||
/** The chunk index. */
|
/** The chunk index, or {@link C#INDEX_UNSET} if it is not known. */
|
||||||
public final long chunkIndex;
|
public final long chunkIndex;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -37,7 +37,7 @@ public abstract class MediaChunk extends Chunk {
|
|||||||
* @param trackSelectionData See {@link #trackSelectionData}.
|
* @param trackSelectionData See {@link #trackSelectionData}.
|
||||||
* @param startTimeUs The start time of the media contained by the chunk, in microseconds.
|
* @param startTimeUs The start time of the media contained by the chunk, in microseconds.
|
||||||
* @param endTimeUs The end time of the media contained by the chunk, in microseconds.
|
* @param endTimeUs The end time of the media contained by the chunk, in microseconds.
|
||||||
* @param chunkIndex The index of the chunk.
|
* @param chunkIndex The index of the chunk, or {@link C#INDEX_UNSET} if it is not known.
|
||||||
*/
|
*/
|
||||||
public MediaChunk(
|
public MediaChunk(
|
||||||
DataSource dataSource,
|
DataSource dataSource,
|
||||||
@ -54,9 +54,9 @@ public abstract class MediaChunk extends Chunk {
|
|||||||
this.chunkIndex = chunkIndex;
|
this.chunkIndex = chunkIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the next chunk index. */
|
/** Returns the next chunk index or {@link C#INDEX_UNSET} if it is not known. */
|
||||||
public long getNextChunkIndex() {
|
public long getNextChunkIndex() {
|
||||||
return chunkIndex + 1;
|
return chunkIndex != C.INDEX_UNSET ? chunkIndex + 1 : C.INDEX_UNSET;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -45,7 +45,7 @@ public final class SingleSampleMediaChunk extends BaseMediaChunk {
|
|||||||
* @param trackSelectionData See {@link #trackSelectionData}.
|
* @param trackSelectionData See {@link #trackSelectionData}.
|
||||||
* @param startTimeUs The start time of the media contained by the chunk, in microseconds.
|
* @param startTimeUs The start time of the media contained by the chunk, in microseconds.
|
||||||
* @param endTimeUs The end time of the media contained by the chunk, in microseconds.
|
* @param endTimeUs The end time of the media contained by the chunk, in microseconds.
|
||||||
* @param chunkIndex The index of the chunk.
|
* @param chunkIndex The index of the chunk, or {@link C#INDEX_UNSET} if it is not known.
|
||||||
* @param trackType The type of the chunk. Typically one of the {@link C} {@code TRACK_TYPE_*}
|
* @param trackType The type of the chunk. Typically one of the {@link C} {@code TRACK_TYPE_*}
|
||||||
* constants.
|
* constants.
|
||||||
* @param sampleFormat The {@link Format} of the sample in the chunk.
|
* @param sampleFormat The {@link Format} of the sample in the chunk.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user