Commit e9ab71a2 by cdrolle Committed by Oliver Woodman

Modified CeaDecoder and CeaSubtitle so that it's correctly setting the…

Modified CeaDecoder and CeaSubtitle so that it's correctly setting the subsampleOffset and making proper use of it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145552166
parent 0a8dc416
......@@ -16,6 +16,7 @@
package com.google.android.exoplayer2.text.cea;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.text.Subtitle;
import com.google.android.exoplayer2.text.SubtitleDecoder;
import com.google.android.exoplayer2.text.SubtitleDecoderException;
......@@ -109,7 +110,7 @@ import java.util.TreeSet;
Subtitle subtitle = createSubtitle();
if (!inputBuffer.isDecodeOnly()) {
SubtitleOutputBuffer outputBuffer = availableOutputBuffers.pollFirst();
outputBuffer.setContent(inputBuffer.timeUs, subtitle, 0);
outputBuffer.setContent(inputBuffer.timeUs, subtitle, Format.OFFSET_SAMPLE_RELATIVE);
releaseInputBuffer(inputBuffer);
return outputBuffer;
}
......
......@@ -15,8 +15,11 @@
*/
package com.google.android.exoplayer2.text.cea;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.text.Cue;
import com.google.android.exoplayer2.text.Subtitle;
import com.google.android.exoplayer2.util.Assertions;
import java.util.Collections;
import java.util.List;
/**
......@@ -35,7 +38,7 @@ import java.util.List;
@Override
public int getNextEventTimeIndex(long timeUs) {
return 0;
return timeUs < 0 ? 0 : C.INDEX_UNSET;
}
@Override
......@@ -45,12 +48,13 @@ import java.util.List;
@Override
public long getEventTime(int index) {
Assertions.checkArgument(index == 0);
return 0;
}
@Override
public List<Cue> getCues(long timeUs) {
return cues;
return timeUs >= 0 ? cues : Collections.<Cue>emptyList();
}
}
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