mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Use MimeType.allSamplesAreSyncSamples in ClippingMediaPeriod
PiperOrigin-RevId: 325409392
This commit is contained in:
parent
6a54ddd217
commit
c7a1151c2b
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
// 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
|
// 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.
|
// 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
|
// However, for tracks where all samples are sync samples, we assume they have random access
|
||||||
// do not need an initial discontinuity to reset the renderer.
|
// seek behaviour and do not need an initial discontinuity to reset the renderer.
|
||||||
if (startUs != 0) {
|
if (startUs != 0) {
|
||||||
for (TrackSelection trackSelection : selections) {
|
for (TrackSelection trackSelection : selections) {
|
||||||
if (trackSelection != null) {
|
if (trackSelection != null) {
|
||||||
Format selectedFormat = trackSelection.getSelectedFormat();
|
Format selectedFormat = trackSelection.getSelectedFormat();
|
||||||
if (!MimeTypes.isAudio(selectedFormat.sampleMimeType)) {
|
if (!MimeTypes.allSamplesAreSyncSamples(selectedFormat.sampleMimeType)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue