Commit faf196a5 by ojw28

Merge pull request #154 from google/dev

Merge dev -> dev-hls
parents 25ddeab5 d506d766
......@@ -268,7 +268,7 @@ public class MediaCodecAudioTrackRenderer extends MediaCodecTrackRenderer {
@Override
protected void seekTo(long positionUs) throws ExoPlaybackException {
super.seekTo(positionUs);
// TODO: Try and re-use the same AudioTrack instance once [redacted] is fixed.
// TODO: Try and re-use the same AudioTrack instance once [Internal: b/7941810] is fixed.
audioTrack.reset();
currentPositionUs = Long.MIN_VALUE;
}
......
......@@ -30,7 +30,8 @@ import android.os.SystemClock;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.HashSet;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
......@@ -141,7 +142,7 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
private final SampleSource source;
private final SampleHolder sampleHolder;
private final MediaFormatHolder formatHolder;
private final HashSet<Long> decodeOnlyPresentationTimestamps;
private final List<Long> decodeOnlyPresentationTimestamps;
private final MediaCodec.BufferInfo outputBufferInfo;
private final EventListener eventListener;
protected final Handler eventHandler;
......@@ -191,7 +192,7 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
codecCounters = new CodecCounters();
sampleHolder = new SampleHolder(SampleHolder.BUFFER_REPLACEMENT_MODE_DISABLED);
formatHolder = new MediaFormatHolder();
decodeOnlyPresentationTimestamps = new HashSet<Long>();
decodeOnlyPresentationTimestamps = new ArrayList<Long>();
outputBufferInfo = new MediaCodec.BufferInfo();
}
......@@ -467,7 +468,7 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
waitingForFirstSyncFrame = true;
decodeOnlyPresentationTimestamps.clear();
// Workaround for framework bugs.
// See [redacted], [redacted], [redacted].
// See [Internal: b/8347958], [Internal: b/8578467], [Internal: b/8543366].
if (Util.SDK_INT >= 18) {
codec.flush();
} else {
......@@ -736,12 +737,11 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
return false;
}
boolean decodeOnly = decodeOnlyPresentationTimestamps.contains(
outputBufferInfo.presentationTimeUs);
int decodeOnlyIdx = getDecodeOnlyIndex(outputBufferInfo.presentationTimeUs);
if (processOutputBuffer(positionUs, elapsedRealtimeUs, codec, outputBuffers[outputIndex],
outputBufferInfo, outputIndex, decodeOnly)) {
if (decodeOnly) {
decodeOnlyPresentationTimestamps.remove(outputBufferInfo.presentationTimeUs);
outputBufferInfo, outputIndex, decodeOnlyIdx >= 0)) {
if (decodeOnlyIdx >= 0) {
decodeOnlyPresentationTimestamps.remove(decodeOnlyIdx);
} else {
currentPositionUs = outputBufferInfo.presentationTimeUs;
}
......@@ -785,4 +785,13 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
}
}
private int getDecodeOnlyIndex(long presentationTimeUs) {
final int size = decodeOnlyPresentationTimestamps.size();
for (int i = 0; i < size; i++) {
if (decodeOnlyPresentationTimestamps.get(i).longValue() == presentationTimeUs) {
return i;
}
}
return -1;
}
}
......@@ -103,7 +103,7 @@ public class MediaCodecVideoTrackRenderer extends MediaCodecTrackRenderer {
}
// TODO: Use MediaFormat constants if these get exposed through the API. See [redacted].
// TODO: Use MediaFormat constants if these get exposed through the API. See [Internal: b/14127601].
private static final String KEY_CROP_LEFT = "crop-left";
private static final String KEY_CROP_RIGHT = "crop-right";
private static final String KEY_CROP_BOTTOM = "crop-bottom";
......
......@@ -583,7 +583,7 @@ public final class FragmentedMp4Extractor implements Extractor {
if (atomType == Atom.TYPE_mp4a || atomType == Atom.TYPE_enca) {
if (childAtomType == Atom.TYPE_esds) {
initializationData = parseEsdsFromParent(parent, childStartPosition);
// TODO: Do we really need to do this? See [redacted]
// TODO: Do we really need to do this? See [Internal: b/10903778]
// Update sampleRate and channelCount from the AudioSpecificConfig initialization data.
Pair<Integer, Integer> audioSpecificConfig =
CodecSpecificDataUtil.parseAudioSpecificConfig(initializationData);
......
......@@ -247,7 +247,7 @@ public class TextTrackRenderer extends TrackRenderer implements Callback {
@Override
protected boolean isReady() {
// Don't block playback whilst subtitles are loading.
// Note: To change this behavior, it will be necessary to consider [redacted].
// Note: To change this behavior, it will be necessary to consider [Internal: b/12949941].
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment