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
This commit is contained in:
parent
0a8dc41632
commit
e9ab71a280
@ -16,6 +16,7 @@
|
|||||||
package com.google.android.exoplayer2.text.cea;
|
package com.google.android.exoplayer2.text.cea;
|
||||||
|
|
||||||
import com.google.android.exoplayer2.C;
|
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.Subtitle;
|
||||||
import com.google.android.exoplayer2.text.SubtitleDecoder;
|
import com.google.android.exoplayer2.text.SubtitleDecoder;
|
||||||
import com.google.android.exoplayer2.text.SubtitleDecoderException;
|
import com.google.android.exoplayer2.text.SubtitleDecoderException;
|
||||||
@ -109,7 +110,7 @@ import java.util.TreeSet;
|
|||||||
Subtitle subtitle = createSubtitle();
|
Subtitle subtitle = createSubtitle();
|
||||||
if (!inputBuffer.isDecodeOnly()) {
|
if (!inputBuffer.isDecodeOnly()) {
|
||||||
SubtitleOutputBuffer outputBuffer = availableOutputBuffers.pollFirst();
|
SubtitleOutputBuffer outputBuffer = availableOutputBuffers.pollFirst();
|
||||||
outputBuffer.setContent(inputBuffer.timeUs, subtitle, 0);
|
outputBuffer.setContent(inputBuffer.timeUs, subtitle, Format.OFFSET_SAMPLE_RELATIVE);
|
||||||
releaseInputBuffer(inputBuffer);
|
releaseInputBuffer(inputBuffer);
|
||||||
return outputBuffer;
|
return outputBuffer;
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package com.google.android.exoplayer2.text.cea;
|
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.Cue;
|
||||||
import com.google.android.exoplayer2.text.Subtitle;
|
import com.google.android.exoplayer2.text.Subtitle;
|
||||||
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -35,7 +38,7 @@ import java.util.List;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getNextEventTimeIndex(long timeUs) {
|
public int getNextEventTimeIndex(long timeUs) {
|
||||||
return 0;
|
return timeUs < 0 ? 0 : C.INDEX_UNSET;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -45,12 +48,13 @@ import java.util.List;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getEventTime(int index) {
|
public long getEventTime(int index) {
|
||||||
|
Assertions.checkArgument(index == 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Cue> getCues(long timeUs) {
|
public List<Cue> getCues(long timeUs) {
|
||||||
return cues;
|
return timeUs >= 0 ? cues : Collections.<Cue>emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user