mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix some lint/analyze errors
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=179406910
This commit is contained in:
parent
d9bee4d29c
commit
539d291fce
11 changed files with 24 additions and 17 deletions
|
|
@ -38,6 +38,7 @@ public class OfflineLicenseHelperTest extends InstrumentationTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
|
super.setUp();
|
||||||
MockitoUtil.setUpMockito(this);
|
MockitoUtil.setUpMockito(this);
|
||||||
when(mediaDrm.openSession()).thenReturn(new byte[] {1, 2, 3});
|
when(mediaDrm.openSession()).thenReturn(new byte[] {1, 2, 3});
|
||||||
offlineLicenseHelper = new OfflineLicenseHelper<>(C.WIDEVINE_UUID, mediaDrm, mediaDrmCallback,
|
offlineLicenseHelper = new OfflineLicenseHelper<>(C.WIDEVINE_UUID, mediaDrm, mediaDrmCallback,
|
||||||
|
|
@ -48,6 +49,7 @@ public class OfflineLicenseHelperTest extends InstrumentationTestCase {
|
||||||
protected void tearDown() throws Exception {
|
protected void tearDown() throws Exception {
|
||||||
offlineLicenseHelper.release();
|
offlineLicenseHelper.release();
|
||||||
offlineLicenseHelper = null;
|
offlineLicenseHelper = null;
|
||||||
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testDownloadRenewReleaseKey() throws Exception {
|
public void testDownloadRenewReleaseKey() throws Exception {
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ public class AdtsReaderTest extends TestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
|
super.setUp();
|
||||||
FakeExtractorOutput fakeExtractorOutput = new FakeExtractorOutput();
|
FakeExtractorOutput fakeExtractorOutput = new FakeExtractorOutput();
|
||||||
adtsOutput = fakeExtractorOutput.track(0, C.TRACK_TYPE_AUDIO);
|
adtsOutput = fakeExtractorOutput.track(0, C.TRACK_TYPE_AUDIO);
|
||||||
id3Output = fakeExtractorOutput.track(1, C.TRACK_TYPE_METADATA);
|
id3Output = fakeExtractorOutput.track(1, C.TRACK_TYPE_METADATA);
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ public class CachedContentIndexTest extends InstrumentationTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
|
super.setUp();
|
||||||
cacheDir = Util.createTempDirectory(getInstrumentation().getContext(), "ExoPlayerTest");
|
cacheDir = Util.createTempDirectory(getInstrumentation().getContext(), "ExoPlayerTest");
|
||||||
index = new CachedContentIndex(cacheDir);
|
index = new CachedContentIndex(cacheDir);
|
||||||
}
|
}
|
||||||
|
|
@ -43,6 +44,7 @@ public class CachedContentIndexTest extends InstrumentationTestCase {
|
||||||
@Override
|
@Override
|
||||||
protected void tearDown() throws Exception {
|
protected void tearDown() throws Exception {
|
||||||
Util.recursiveDelete(cacheDir);
|
Util.recursiveDelete(cacheDir);
|
||||||
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAddGetRemove() throws Exception {
|
public void testAddGetRemove() throws Exception {
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@ public final class CachedRegionTrackerTest extends InstrumentationTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
|
super.setUp();
|
||||||
MockitoUtil.setUpMockito(this);
|
MockitoUtil.setUpMockito(this);
|
||||||
|
|
||||||
tracker = new CachedRegionTracker(cache, CACHE_KEY, CHUNK_INDEX);
|
tracker = new CachedRegionTracker(cache, CACHE_KEY, CHUNK_INDEX);
|
||||||
cacheDir = Util.createTempDirectory(getInstrumentation().getContext(), "ExoPlayerTest");
|
cacheDir = Util.createTempDirectory(getInstrumentation().getContext(), "ExoPlayerTest");
|
||||||
index = new CachedContentIndex(cacheDir);
|
index = new CachedContentIndex(cacheDir);
|
||||||
|
|
@ -56,6 +56,7 @@ public final class CachedRegionTrackerTest extends InstrumentationTestCase {
|
||||||
@Override
|
@Override
|
||||||
protected void tearDown() throws Exception {
|
protected void tearDown() throws Exception {
|
||||||
Util.recursiveDelete(cacheDir);
|
Util.recursiveDelete(cacheDir);
|
||||||
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testGetRegion_noSpansInCache() {
|
public void testGetRegion_noSpansInCache() {
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ public class SimpleCacheSpanTest extends InstrumentationTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
|
super.setUp();
|
||||||
cacheDir = Util.createTempDirectory(getInstrumentation().getContext(), "ExoPlayerTest");
|
cacheDir = Util.createTempDirectory(getInstrumentation().getContext(), "ExoPlayerTest");
|
||||||
index = new CachedContentIndex(cacheDir);
|
index = new CachedContentIndex(cacheDir);
|
||||||
}
|
}
|
||||||
|
|
@ -55,6 +56,7 @@ public class SimpleCacheSpanTest extends InstrumentationTestCase {
|
||||||
@Override
|
@Override
|
||||||
protected void tearDown() throws Exception {
|
protected void tearDown() throws Exception {
|
||||||
Util.recursiveDelete(cacheDir);
|
Util.recursiveDelete(cacheDir);
|
||||||
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testCacheFile() throws Exception {
|
public void testCacheFile() throws Exception {
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,8 @@ import java.util.Arrays;
|
||||||
/**
|
/**
|
||||||
* Resets the channel mapping. After calling this method, call {@link #configure(int, int, int)}
|
* Resets the channel mapping. After calling this method, call {@link #configure(int, int, int)}
|
||||||
* to start using the new channel map.
|
* to start using the new channel map.
|
||||||
|
*
|
||||||
|
* @see AudioSink#configure(int, int, int, int, int[], int, int)
|
||||||
*/
|
*/
|
||||||
public void setChannelMap(int[] outputChannels) {
|
public void setChannelMap(int[] outputChannels) {
|
||||||
pendingOutputChannels = outputChannels;
|
pendingOutputChannels = outputChannels;
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,7 @@ import java.nio.ByteOrder;
|
||||||
resampledSize = size / 2;
|
resampledSize = size / 2;
|
||||||
break;
|
break;
|
||||||
case C.ENCODING_PCM_16BIT:
|
case C.ENCODING_PCM_16BIT:
|
||||||
|
case C.ENCODING_PCM_FLOAT:
|
||||||
case C.ENCODING_INVALID:
|
case C.ENCODING_INVALID:
|
||||||
case Format.NO_VALUE:
|
case Format.NO_VALUE:
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,6 @@ public final class LatmReader implements ElementaryStreamReader {
|
||||||
|
|
||||||
// Container data.
|
// Container data.
|
||||||
private boolean streamMuxRead;
|
private boolean streamMuxRead;
|
||||||
private int audioMuxVersion;
|
|
||||||
private int audioMuxVersionA;
|
private int audioMuxVersionA;
|
||||||
private int numSubframes;
|
private int numSubframes;
|
||||||
private int frameLengthType;
|
private int frameLengthType;
|
||||||
|
|
@ -176,7 +175,7 @@ public final class LatmReader implements ElementaryStreamReader {
|
||||||
* Parses a StreamMuxConfig as defined in ISO/IEC 14496-3:2009 Section 1.7.3.1, Table 1.42.
|
* Parses a StreamMuxConfig as defined in ISO/IEC 14496-3:2009 Section 1.7.3.1, Table 1.42.
|
||||||
*/
|
*/
|
||||||
private void parseStreamMuxConfig(ParsableBitArray data) throws ParserException {
|
private void parseStreamMuxConfig(ParsableBitArray data) throws ParserException {
|
||||||
audioMuxVersion = data.readBits(1);
|
int audioMuxVersion = data.readBits(1);
|
||||||
audioMuxVersionA = audioMuxVersion == 1 ? data.readBits(1) : 0;
|
audioMuxVersionA = audioMuxVersion == 1 ? data.readBits(1) : 0;
|
||||||
if (audioMuxVersionA == 0) {
|
if (audioMuxVersionA == 0) {
|
||||||
if (audioMuxVersion == 1) {
|
if (audioMuxVersion == 1) {
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ package com.google.android.exoplayer2.trackselection;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
import com.google.android.exoplayer2.ExoPlaybackException;
|
||||||
|
|
@ -1216,11 +1217,11 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
||||||
* Compares the score of the current track format with another {@link AudioTrackScore}.
|
* Compares the score of the current track format with another {@link AudioTrackScore}.
|
||||||
*
|
*
|
||||||
* @param other The other score to compare to.
|
* @param other The other score to compare to.
|
||||||
* @return A positive integer if this score is better than the other. Zero if they are
|
* @return A positive integer if this score is better than the other. Zero if they are equal. A
|
||||||
* equal. A negative integer if this score is worse than the other.
|
* negative integer if this score is worse than the other.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(AudioTrackScore other) {
|
public int compareTo(@NonNull AudioTrackScore other) {
|
||||||
if (this.withinRendererCapabilitiesScore != other.withinRendererCapabilitiesScore) {
|
if (this.withinRendererCapabilitiesScore != other.withinRendererCapabilitiesScore) {
|
||||||
return compareInts(this.withinRendererCapabilitiesScore,
|
return compareInts(this.withinRendererCapabilitiesScore,
|
||||||
other.withinRendererCapabilitiesScore);
|
other.withinRendererCapabilitiesScore);
|
||||||
|
|
|
||||||
|
|
@ -91,12 +91,10 @@ public final class ColorInfo implements Parcelable {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ColorInfo other = (ColorInfo) obj;
|
ColorInfo other = (ColorInfo) obj;
|
||||||
if (colorSpace != other.colorSpace || colorRange != other.colorRange
|
return colorSpace == other.colorSpace
|
||||||
|| colorTransfer != other.colorTransfer
|
&& colorRange == other.colorRange
|
||||||
|| !Arrays.equals(hdrStaticInfo, other.hdrStaticInfo)) {
|
&& colorTransfer == other.colorTransfer
|
||||||
return false;
|
&& Arrays.equals(hdrStaticInfo, other.hdrStaticInfo);
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -481,11 +481,9 @@ public class FakeSimpleExoPlayer extends SimpleExoPlayer {
|
||||||
|
|
||||||
private boolean haveSufficientBuffer(boolean rebuffering, long rendererPositionUs,
|
private boolean haveSufficientBuffer(boolean rebuffering, long rendererPositionUs,
|
||||||
long bufferedPositionUs) {
|
long bufferedPositionUs) {
|
||||||
if (bufferedPositionUs == C.TIME_END_OF_SOURCE) {
|
return bufferedPositionUs == C.TIME_END_OF_SOURCE
|
||||||
return true;
|
|| loadControl.shouldStartPlayback(
|
||||||
}
|
bufferedPositionUs - rendererPositionUs, 1f, rebuffering);
|
||||||
return
|
|
||||||
loadControl.shouldStartPlayback(bufferedPositionUs - rendererPositionUs, 1f, rebuffering);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handlePlayerError(final ExoPlaybackException e) {
|
private void handlePlayerError(final ExoPlaybackException e) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue