mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Address the minor issues from pull request review
Address the minor issues raised in @AquilesCanta's review of pull request 6270. Also remove unused variable (`hasIFrameVariants`)
This commit is contained in:
parent
1f11233ba0
commit
8c4d31a9df
2 changed files with 6 additions and 6 deletions
|
|
@ -541,10 +541,10 @@ public class AdaptiveTrackSelection extends BaseTrackSelection {
|
||||||
protected boolean canSelectFormat(
|
protected boolean canSelectFormat(
|
||||||
Format format, int trackBitrate, float playbackSpeed, long effectiveBitrate) {
|
Format format, int trackBitrate, float playbackSpeed, long effectiveBitrate) {
|
||||||
|
|
||||||
boolean isNonIframeOnly = (format.roleFlags & C.ROLE_FLAG_TRICK_PLAY) == 0;
|
boolean isIframeOnlyFormat = (format.roleFlags & C.ROLE_FLAG_TRICK_PLAY) != 0;
|
||||||
boolean canSelect = Math.round(trackBitrate * playbackSpeed) <= effectiveBitrate;
|
boolean canSelect = Math.round(trackBitrate * playbackSpeed) <= effectiveBitrate;
|
||||||
|
|
||||||
return canSelect && isNonIframeOnly; // Default is not to use the IDR only tracks in selection
|
return canSelect && !isIframeOnlyFormat; // Default is not to use the IDR only tracks in selection
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -470,7 +470,6 @@ public final class HlsMediaPeriod implements MediaPeriod, HlsSampleStreamWrapper
|
||||||
: Collections.emptyMap();
|
: Collections.emptyMap();
|
||||||
|
|
||||||
boolean hasVariants = !masterPlaylist.variants.isEmpty();
|
boolean hasVariants = !masterPlaylist.variants.isEmpty();
|
||||||
boolean hasIFrameVariants = !masterPlaylist.iFrameVariants.isEmpty();
|
|
||||||
List<Rendition> audioRenditions = masterPlaylist.audios;
|
List<Rendition> audioRenditions = masterPlaylist.audios;
|
||||||
List<Rendition> subtitleRenditions = masterPlaylist.subtitles;
|
List<Rendition> subtitleRenditions = masterPlaylist.subtitles;
|
||||||
|
|
||||||
|
|
@ -564,7 +563,8 @@ public final class HlsMediaPeriod implements MediaPeriod, HlsSampleStreamWrapper
|
||||||
long positionUs,
|
long positionUs,
|
||||||
List<HlsSampleStreamWrapper> sampleStreamWrappers,
|
List<HlsSampleStreamWrapper> sampleStreamWrappers,
|
||||||
List<int[]> manifestUrlIndicesPerWrapper,
|
List<int[]> manifestUrlIndicesPerWrapper,
|
||||||
Map<String, DrmInitData> overridingDrmInitData, List<Variant> variants) {
|
Map<String, DrmInitData> overridingDrmInitData,
|
||||||
|
List<Variant> variants) {
|
||||||
int[] variantTypes = new int[variants.size()];
|
int[] variantTypes = new int[variants.size()];
|
||||||
int videoVariantCount = 0;
|
int videoVariantCount = 0;
|
||||||
int audioVariantCount = 0;
|
int audioVariantCount = 0;
|
||||||
|
|
@ -627,8 +627,8 @@ public final class HlsMediaPeriod implements MediaPeriod, HlsSampleStreamWrapper
|
||||||
List<TrackGroup> muxedTrackGroups = new ArrayList<>();
|
List<TrackGroup> muxedTrackGroups = new ArrayList<>();
|
||||||
if (variantsContainVideoCodecs) {
|
if (variantsContainVideoCodecs) {
|
||||||
Format[] videoFormats = new Format[selectedVariantsCount];
|
Format[] videoFormats = new Format[selectedVariantsCount];
|
||||||
for (int i1 = 0; i1 < videoFormats.length; i1++) {
|
for (int i = 0; i < videoFormats.length; i++) {
|
||||||
videoFormats[i1] = deriveVideoFormat(selectedPlaylistFormats[i1]);
|
videoFormats[i] = deriveVideoFormat(selectedPlaylistFormats[i]);
|
||||||
}
|
}
|
||||||
muxedTrackGroups.add(new TrackGroup(videoFormats));
|
muxedTrackGroups.add(new TrackGroup(videoFormats));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue