Skip to content

Commit

Permalink
Remove dead code in ProgressiveMediaSource.Builder
Browse files Browse the repository at this point in the history
These fields cannot be set and the logic to handle them can be removed.

PiperOrigin-RevId: 544646460
  • Loading branch information
tonihei authored and microkatz committed Jul 5, 2023
1 parent a875fa7 commit 2f113c8
Showing 1 changed file with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ public static final class Factory implements MediaSourceFactory {
private DrmSessionManagerProvider drmSessionManagerProvider;
private LoadErrorHandlingPolicy loadErrorHandlingPolicy;
private int continueLoadingCheckIntervalBytes;
@Nullable private String customCacheKey;
@Nullable private Object tag;

/**
* Creates a new factory for {@link ProgressiveMediaSource}s.
Expand Down Expand Up @@ -207,16 +205,6 @@ public Factory setDrmSessionManagerProvider(
@Override
public ProgressiveMediaSource createMediaSource(MediaItem mediaItem) {
checkNotNull(mediaItem.localConfiguration);
boolean needsTag = mediaItem.localConfiguration.tag == null && tag != null;
boolean needsCustomCacheKey =
mediaItem.localConfiguration.customCacheKey == null && customCacheKey != null;
if (needsTag && needsCustomCacheKey) {
mediaItem = mediaItem.buildUpon().setTag(tag).setCustomCacheKey(customCacheKey).build();
} else if (needsTag) {
mediaItem = mediaItem.buildUpon().setTag(tag).build();
} else if (needsCustomCacheKey) {
mediaItem = mediaItem.buildUpon().setCustomCacheKey(customCacheKey).build();
}
return new ProgressiveMediaSource(
mediaItem,
dataSourceFactory,
Expand Down

0 comments on commit 2f113c8

Please sign in to comment.