androidx / androidx/media

Returning from an interstitial playlist causes renderer disable and then reenable

Open
#3,371 3 comments 0 reactions 1 assignee View on GitHub

@tonihei is already working on this.

Since Sep 8, 2026.

bug
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Version

Media3 1.11.0

Description

Let's assume we are playing a playlist with several interstitial playlists, so the resulting playback looks like AaBbC, where (A), (B) and (C) are from the main playlist and (a) and (b) are interstitial playlists. The result is that between (a) and (B) the player is disabling and then reenabling the renderers. This happens because the player creates in MediaPeriodHolder.createMediaPeriod() a ClippingMediaPeriod for (A) and (B) (but not for (C) which has endPositionUs = C.TIME_UNSET).
Both new ClippingMediaPeriod() calls have enableInitialDiscontinuity=false (as isPrecededByTransitionFromSameStream=false) and such initial discontinuity causes renderers restart at the moment (B) starts playback. Modifying code to have enableInitialDiscontinuity=true for the periods following interstitials solves this problem.

Devices that reproduce the issue

Was reproduced on a proprietary Android device, but I do not believe the device is important.

Reproducible in the demo app?

Yes

Note: The demo app was modified to allow playback of the content with interstitials.

Reproduction steps

Play a VoD content with several interstitials with SNAP=IN,
The main VoD content and all the interstitials should use the same set of video variants.

Expected result

Smooth playback with all the transitions from the main content to interstitials and back happening without the renderers being disabled (and then reenabled).

Actual result

Returning from all but the last interstitial playlist causes renderer disable/re-enable (and as a result quite a noticeable "hesitation" in the playback).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.