Skip to content

Commit

Permalink
Fix some random Android Studio warnings.
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215904019
  • Loading branch information
tonihei authored and ojw28 committed Oct 15, 2018
1 parent 8dedbd5 commit 0a7745b
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,7 @@ private Sample readEntry(JsonReader reader, boolean insidePlaylist) throws IOExc
? null
: new DrmInfo(drmScheme, drmLicenseUrl, drmKeyRequestProperties, drmMultiSession);
if (playlistSamples != null) {
UriSample[] playlistSamplesArray = playlistSamples.toArray(
new UriSample[playlistSamples.size()]);
UriSample[] playlistSamplesArray = playlistSamples.toArray(new UriSample[0]);
return new PlaylistSample(sampleName, drmInfo, playlistSamplesArray);
} else {
return new UriSample(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public Renderer[] createRenderers(
extensionRendererMode, renderersList);
buildCameraMotionRenderers(context, extensionRendererMode, renderersList);
buildMiscellaneousRenderers(context, eventHandler, extensionRendererMode, renderersList);
return renderersList.toArray(new Renderer[renderersList.size()]);
return renderersList.toArray(new Renderer[0]);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ private void reselectTracksInternal() throws ExoPlaybackException {
MediaPeriodHolder periodHolder = queue.getPlayingPeriod();
MediaPeriodHolder readingPeriodHolder = queue.getReadingPeriod();
boolean selectionsChangedForReadPeriod = true;
TrackSelectorResult newTrackSelectorResult = null;
TrackSelectorResult newTrackSelectorResult;
while (true) {
if (periodHolder == null || !periodHolder.prepared) {
// The reselection did not change any prepared periods.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,7 @@ public DefaultAudioSink(
channelMappingAudioProcessor,
trimmingAudioProcessor);
Collections.addAll(toIntPcmAudioProcessors, audioProcessorChain.getAudioProcessors());
toIntPcmAvailableAudioProcessors =
toIntPcmAudioProcessors.toArray(new AudioProcessor[toIntPcmAudioProcessors.size()]);
toIntPcmAvailableAudioProcessors = toIntPcmAudioProcessors.toArray(new AudioProcessor[0]);
toFloatPcmAvailableAudioProcessors = new AudioProcessor[] {new FloatResamplingAudioProcessor()};
volume = 1.0f;
startMediaTimeState = START_NOT_SET;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
* @param schemeDatas Scheme initialization data for possibly multiple DRM schemes.
*/
public DrmInitData(List<SchemeData> schemeDatas) {
this(null, false, schemeDatas.toArray(new SchemeData[schemeDatas.size()]));
this(null, false, schemeDatas.toArray(new SchemeData[0]));
}

/**
* @param schemeType See {@link #schemeType}.
* @param schemeDatas Scheme initialization data for possibly multiple DRM schemes.
*/
public DrmInitData(@Nullable String schemeType, List<SchemeData> schemeDatas) {
this(schemeType, false, schemeDatas.toArray(new SchemeData[schemeDatas.size()]));
this(schemeType, false, schemeDatas.toArray(new SchemeData[0]));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ TimestampSearchResult searchForTimestamp(
*/
public static final class OutputFrameHolder {

public final ByteBuffer byteBuffer;

public long timeUs;
public ByteBuffer byteBuffer;

/** Constructs an instance, wrapping the given byte buffer. */
public OutputFrameHolder(ByteBuffer outputByteBuffer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ private void processMoovAtom(ContainerAtom moov) throws ParserException {
}
this.firstVideoTrackIndex = firstVideoTrackIndex;
this.durationUs = durationUs;
this.tracks = tracks.toArray(new Mp4Track[tracks.size()]);
this.tracks = tracks.toArray(new Mp4Track[0]);
accumulatedSampleSizes = calculateAccumulatedSampleSizes(this.tracks);

extractorOutput.endTracks();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,7 @@ private static Object getPeriodUid(MediaSourceHolder holder, Object childPeriodU

public final MediaSource mediaSource;
public final Object uid;
public final List<DeferredMediaPeriod> activeMediaPeriods;

public DeferredTimeline timeline;
public int childIndex;
Expand All @@ -809,7 +810,6 @@ private static Object getPeriodUid(MediaSourceHolder holder, Object childPeriodU
public boolean hasStartedPreparing;
public boolean isPrepared;
public boolean isRemoved;
public List<DeferredMediaPeriod> activeMediaPeriods;

public MediaSourceHolder(MediaSource mediaSource) {
this.mediaSource = mediaSource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import android.support.annotation.NonNull;
import com.google.android.exoplayer2.extractor.ChunkIndex;
import com.google.android.exoplayer2.util.Log;
import com.google.android.exoplayer2.util.Util;
import java.util.Arrays;
import java.util.Iterator;
import java.util.NavigableSet;
Expand Down Expand Up @@ -195,8 +196,7 @@ public Region(long position, long endOffset) {

@Override
public int compareTo(@NonNull Region another) {
return startOffset < another.startOffset ? -1
: startOffset == another.startOffset ? 0 : 1;
return Util.compareLong(startOffset, another.startOffset);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,12 @@ public boolean onTouchEvent(MotionEvent ev) {
if (ev.getActionMasked() != MotionEvent.ACTION_DOWN) {
return false;
}
return performClick();
}

@Override
public boolean performClick() {
super.performClick();
return toggleControllerVisibility();
}

Expand Down

0 comments on commit 0a7745b

Please sign in to comment.