mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
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;
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user