diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/ClippingMediaPeriod.java b/library/core/src/main/java/com/google/android/exoplayer2/source/ClippingMediaPeriod.java index c5484a8f45..31254907fe 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/ClippingMediaPeriod.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/source/ClippingMediaPeriod.java @@ -258,13 +258,13 @@ public final class ClippingMediaPeriod implements MediaPeriod, MediaPeriod.Callb // negative timestamp, its offset timestamp can jump backwards compared to the last timestamp // read in the previous period. Renderer implementations may not allow this, so we signal a // discontinuity which resets the renderers before they read the clipping sample stream. - // However, for audio-only track selections we assume to have random access seek behaviour and - // do not need an initial discontinuity to reset the renderer. + // However, for tracks where all samples are sync samples, we assume they have random access + // seek behaviour and do not need an initial discontinuity to reset the renderer. if (startUs != 0) { for (TrackSelection trackSelection : selections) { if (trackSelection != null) { Format selectedFormat = trackSelection.getSelectedFormat(); - if (!MimeTypes.isAudio(selectedFormat.sampleMimeType)) { + if (!MimeTypes.allSamplesAreSyncSamples(selectedFormat.sampleMimeType)) { return true; } }