mirror of
https://github.com/samsonjs/media.git
synced 2026-04-18 13:25:47 +00:00
Fix the preparation of Extractor inside the init() method
Extractor was not calling endTracks() and seekMap() on the extractorOutput which are required to finish the preparation. At that point extractor does not support seeking. PiperOrigin-RevId: 393994848
This commit is contained in:
parent
882957228c
commit
095c63933b
1 changed files with 3 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ import com.google.android.exoplayer2.extractor.Extractor;
|
|||
import com.google.android.exoplayer2.extractor.ExtractorInput;
|
||||
import com.google.android.exoplayer2.extractor.ExtractorOutput;
|
||||
import com.google.android.exoplayer2.extractor.PositionHolder;
|
||||
import com.google.android.exoplayer2.extractor.SeekMap;
|
||||
import com.google.android.exoplayer2.extractor.TrackOutput;
|
||||
import com.google.android.exoplayer2.text.Cue;
|
||||
import com.google.android.exoplayer2.text.CueEncoder;
|
||||
|
|
@ -117,6 +118,8 @@ public class SubtitleExtractor implements Extractor {
|
|||
checkState(state == STATE_CREATED);
|
||||
extractorOutput = output;
|
||||
trackOutput = extractorOutput.track(/* id= */ 0, C.TRACK_TYPE_TEXT);
|
||||
extractorOutput.endTracks();
|
||||
extractorOutput.seekMap(new SeekMap.Unseekable(C.TIME_UNSET));
|
||||
trackOutput.format(format);
|
||||
state = STATE_INITIALIZED;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue