mirror of
https://github.com/samsonjs/media.git
synced 2026-04-05 11:15:46 +00:00
Ignore MetadataRenderer when evaluating SSAI period transitions
This makes the reading period advance early as expected at the end of an ad
period. Before this change the reading position of the metadata renderer
prevented advancing the period until metadata arrived after the start position of
the following period. Only then the reading position of the metadata renderer
is updated and beyond the start position of the following period which is a
condition to advance the reading period.
Because transitioning to the next period is a virtual transition and the
SharedMediaPeriod keeps reading from the same underlying sample streams, the
metadata renderer can safely be ignored for this check.
#minor-release
PiperOrigin-RevId: 432646037
(cherry picked from commit c7c7517322)
This commit is contained in:
parent
c56c6a2ea4
commit
dc83fae19d
1 changed files with 2 additions and 0 deletions
|
|
@ -56,6 +56,7 @@ import androidx.media3.exoplayer.DefaultMediaClock.PlaybackParametersListener;
|
|||
import androidx.media3.exoplayer.analytics.AnalyticsCollector;
|
||||
import androidx.media3.exoplayer.analytics.PlayerId;
|
||||
import androidx.media3.exoplayer.drm.DrmSession;
|
||||
import androidx.media3.exoplayer.metadata.MetadataRenderer;
|
||||
import androidx.media3.exoplayer.source.BehindLiveWindowException;
|
||||
import androidx.media3.exoplayer.source.MediaPeriod;
|
||||
import androidx.media3.exoplayer.source.MediaSource.MediaPeriodId;
|
||||
|
|
@ -2228,6 +2229,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
return reading.info.isFollowedByTransitionToSameStream
|
||||
&& nextPeriod.prepared
|
||||
&& (renderer instanceof TextRenderer // [internal: b/181312195]
|
||||
|| renderer instanceof MetadataRenderer
|
||||
|| renderer.getReadingPositionUs() >= nextPeriod.getStartPositionRendererTime());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue