File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
app/src/main/java/org/schabi/newpipe/player/helper Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 88import androidx .annotation .Nullable ;
99
1010import com .google .android .exoplayer2 .database .StandaloneDatabaseProvider ;
11+ import com .google .android .exoplayer2 .extractor .ts .DefaultTsPayloadReaderFactory ;
1112import com .google .android .exoplayer2 .source .ProgressiveMediaSource ;
1213import com .google .android .exoplayer2 .source .SingleSampleMediaSource ;
1314import com .google .android .exoplayer2 .source .dash .DashMediaSource ;
1415import com .google .android .exoplayer2 .source .dash .DefaultDashChunkSource ;
16+ import com .google .android .exoplayer2 .source .hls .DefaultHlsExtractorFactory ;
1517import com .google .android .exoplayer2 .source .hls .HlsMediaSource ;
1618import com .google .android .exoplayer2 .source .hls .playlist .DefaultHlsPlaylistTracker ;
1719import com .google .android .exoplayer2 .source .smoothstreaming .DefaultSsChunkSource ;
@@ -175,7 +177,11 @@ public SingleSampleMediaSource.Factory getSingleSampleMediaSourceFactory() {
175177
176178 //region YouTube media source factories
177179 public HlsMediaSource .Factory getYoutubeHlsMediaSourceFactory () {
178- return new HlsMediaSource .Factory (ytHlsCacheDataSourceFactory );
180+ // these custom flags fix AVC1/H264 stutter on some Pixel devices, see
181+ // https://github.com/InfinityLoop1308/PipePipeClient/pull/24
182+ final int payloadReaderFlags = DefaultTsPayloadReaderFactory .FLAG_DETECT_ACCESS_UNITS ;
183+ return new HlsMediaSource .Factory (ytHlsCacheDataSourceFactory )
184+ .setExtractorFactory (new DefaultHlsExtractorFactory (payloadReaderFlags , true ));
179185 }
180186
181187 public DashMediaSource .Factory getYoutubeDashMediaSourceFactory () {
You can’t perform that action at this time.
0 commit comments