Skip to content

Commit

Permalink
Remove DefaultSsChunkSource from nullness blacklist
Browse files Browse the repository at this point in the history
Issue: #6981
PiperOrigin-RevId: 295584705
  • Loading branch information
ojw28 authored and icbaker committed Feb 17, 2020
1 parent 3591562 commit 1dbf299
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ public abstract class Chunk implements Loadable {
public final Format trackFormat;
/**
* One of the {@link C} {@code SELECTION_REASON_*} constants if the chunk belongs to a track.
* {@link C#SELECTION_REASON_UNKNOWN} if the chunk does not belong to a track.
* {@link C#SELECTION_REASON_UNKNOWN} if the chunk does not belong to a track, or if the selection
* reason is unknown.
*/
public final int trackSelectionReason;
/**
* Optional data associated with the selection of the track to which this chunk belongs. Null if
* the chunk does not belong to a track.
* the chunk does not belong to a track, or if there is no associated track selection data.
*/
@Nullable public final Object trackSelectionData;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.google.android.exoplayer2.source.chunk;

import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.extractor.DefaultExtractorInput;
Expand Down Expand Up @@ -67,7 +68,7 @@ public ContainerMediaChunk(
DataSpec dataSpec,
Format trackFormat,
int trackSelectionReason,
Object trackSelectionData,
@Nullable Object trackSelectionData,
long startTimeUs,
long endTimeUs,
long clippedStartTimeUs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import com.google.android.exoplayer2.upstream.DataSpec;
import com.google.android.exoplayer2.upstream.LoaderErrorThrower;
import com.google.android.exoplayer2.upstream.TransferListener;
import com.google.android.exoplayer2.util.Assertions;
import java.io.IOException;
import java.util.List;

Expand Down Expand Up @@ -80,7 +81,7 @@ public SsChunkSource createChunkSource(
private SsManifest manifest;
private int currentManifestChunkOffset;

private IOException fatalError;
@Nullable private IOException fatalError;

/**
* @param manifestLoaderErrorThrower Throws errors affecting loading of manifests.
Expand All @@ -106,8 +107,11 @@ public DefaultSsChunkSource(
for (int i = 0; i < extractorWrappers.length; i++) {
int manifestTrackIndex = trackSelection.getIndexInTrackGroup(i);
Format format = streamElement.formats[manifestTrackIndex];
@Nullable
TrackEncryptionBox[] trackEncryptionBoxes =
format.drmInitData != null ? manifest.protectionElement.trackEncryptionBoxes : null;
format.drmInitData != null
? Assertions.checkNotNull(manifest.protectionElement).trackEncryptionBoxes
: null;
int nalUnitLengthFieldLength = streamElement.type == C.TRACK_TYPE_VIDEO ? 4 : 0;
Track track = new Track(manifestTrackIndex, streamElement.type, streamElement.timescale,
C.TIME_UNSET, manifest.durationUs, format, Track.TRANSFORMATION_NONE,
Expand Down Expand Up @@ -277,7 +281,7 @@ private static MediaChunk newMediaChunk(
long chunkEndTimeUs,
long chunkSeekTimeUs,
int trackSelectionReason,
Object trackSelectionData,
@Nullable Object trackSelectionData,
ChunkExtractorWrapper extractorWrapper) {
DataSpec dataSpec = new DataSpec(uri);
// In SmoothStreaming each chunk contains sample timestamps relative to the start of the chunk.
Expand Down

0 comments on commit 1dbf299

Please sign in to comment.