Skip to content

Commit

Permalink
Increase tsExtractorTimestampSearchBytes
Browse files Browse the repository at this point in the history
  • Loading branch information
moneytoo committed Feb 11, 2021
1 parent a06f9b0 commit dfed954
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/src/main/java/com/brouken/player/PlayerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
import com.google.android.exoplayer2.audio.AudioAttributes;
import com.google.android.exoplayer2.audio.AudioListener;
import com.google.android.exoplayer2.ext.mediasession.MediaSessionConnector;
import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory;
import com.google.android.exoplayer2.extractor.ts.TsExtractor;
import com.google.android.exoplayer2.source.DefaultMediaSourceFactory;
import com.google.android.exoplayer2.source.TrackGroupArray;
import com.google.android.exoplayer2.text.CaptionStyleCompat;
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
Expand Down Expand Up @@ -557,8 +560,12 @@ private void initializePlayer() {
trackSelector.buildUponParameters().setMaxVideoSizeSd());*/
RenderersFactory renderersFactory = new DefaultRenderersFactory(this)
.setExtensionRendererMode(DefaultRenderersFactory.EXTENSION_RENDERER_MODE_ON);
// https://github.com/google/ExoPlayer/issues/8571
final DefaultExtractorsFactory extractorsFactory = new DefaultExtractorsFactory()
.setTsExtractorTimestampSearchBytes(1500 * TsExtractor.TS_PACKET_SIZE);
player = new SimpleExoPlayer.Builder(this, renderersFactory)
.setTrackSelector(trackSelector)
.setMediaSourceFactory(new DefaultMediaSourceFactory(this, extractorsFactory))
.build();
final AudioAttributes audioAttributes = new AudioAttributes.Builder()
.setUsage(C.USAGE_MEDIA)
Expand Down

0 comments on commit dfed954

Please sign in to comment.