mirror of
https://github.com/androidx/media.git
synced 2025-05-04 06:00:37 +08:00

The method to handle Timeline updates currently uses isAd() || isPlaceholder() to trigger two things: 1. Using the existing requested content position as the content position. 2. Re-resolving the content position from window to period in case it changed since the last update. The condition is correct for case (1) because ads must use the content position (and not the position in the ad) and a placeholder period must keep using the requested content position as well until the media information is no longer a placeholder. However, case (2) only needs to be done if the content position is C.TIME_UNSET (to start at the default position) OR if the period is still a placeholder and we want to re-resolve the position. The case where re-resolution shouldn't be done is for ads with a non- placeholder period and a concrete content position. This likely only affects ads in live stream where the content position is currently moving with the live stream instead of staying where it is. PiperOrigin-RevId: 372929439