
To avoid the `MediaPeriodQueue`to discard the reading period, we can set the next ad of an ad group early and then (possibly) only change it's duration once we receive the actual duration. This way we avoid a rebuffering as a result of the reading period being discarded. The change also takes care to properly set ad break and their durations when we join the live stream at the moment when an ad is playing. PiperOrigin-RevId: 423163467