media/libraries/exoplayer/src/main/java/androidx/media3/exoplayer
tonihei 5c8b142174 Fix inconsistency in SampleQueue seek for sync-sample-only formats
For sync-sample-only formats, we have an optimization to drop all buffers
with less than the start time when writing them to the queue.

For the same formats, if we set a new start time (=seek), we only seek
to the buffer at or before the start time. This means the first sample
in the queue is different depending on whether we seek to a start time
or set a start time and then write samples. This is inconsistent and
effectively means the first sample depends on a race condition between
the Loader thread (writing samples) and the playback thread (attempting
an initial seek in the already loaded samples).

The effect of this inconsistency is that we have to decode one sample
we don't need (and could have skipped) and that some tests become flaky
if the test setup runs into the mentioned race condition.

The fix is to change the SampleQueue seek method to also seek to
a sample at or after the specified time, to align the behavior to the
case where we write the same samples to an empty queue.

The change also clarifies the Javadoc of
MimeTypes.allSamplesAreSyncSamples to note that this should really only
return true if the samples have no "duration" that matters. Otherwise,
we could reasonably return true for most subtitle formats although it
would break subtitle display because we'd remove samples that start
before the seek time.

PiperOrigin-RevId: 547189941
2023-07-13 15:41:49 +01:00
..
analytics Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
audio Add support for big endian 24/32-bit PCM 2023-07-13 15:31:14 +01:00
drm Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
mediacodec Use Clock in audio renderers and sinks 2023-07-13 15:09:37 +01:00
metadata Update presentation time of metadata when the stream offset changes 2022-09-30 17:34:37 +00:00
offline Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
scheduler Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
source Fix inconsistency in SampleQueue seek for sync-sample-only formats 2023-07-13 15:41:49 +01:00
text SubripParser implementation - moved from SubripDecoder 2023-07-13 15:21:55 +01:00
trackselection Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
upstream Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
util Log Format.colorInfo 2023-03-14 07:53:43 +00:00
video Add customization option to disable same-release-time skipping 2023-07-13 14:57:41 +01:00
AbstractConcatenatedTimeline.java Update to androidx.media3 2021-10-27 09:12:46 +01:00
AudioBecomingNoisyManager.java Do not specify export flags for protected system broadcasts. 2023-02-27 18:39:07 +00:00
AudioFocusManager.java Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
BaseRenderer.java Use Clock in video renderers 2023-07-13 14:54:10 +01:00
DecoderCounters.java Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
DecoderReuseEvaluation.java Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
DefaultLivePlaybackSpeedControl.java Annotate methods that always return this with @CanIgnoreReturnValue 2022-08-08 07:55:25 +00:00
DefaultLoadControl.java Remove deprecated DefaultLoadControl.Builder.createDefaultLoadControl() 2023-05-24 15:50:05 +01:00
DefaultMediaClock.java Update to androidx.media3 2021-10-27 09:12:46 +01:00
DefaultRenderersFactory.java Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
ExoPlaybackException.java Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
ExoPlayer.java Add MediaSource.canUpdateMediaItem/updateMediaItem 2023-07-05 09:21:22 +00:00
ExoPlayerImpl.java Add MediaSource.canUpdateMediaItem/updateMediaItem 2023-07-05 09:21:22 +00:00
ExoPlayerImplInternal.java Use Clock in video renderers 2023-07-13 14:54:10 +01:00
ExoTimeoutException.java Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
FormatHolder.java Update to androidx.media3 2021-10-27 09:12:46 +01:00
LivePlaybackSpeedControl.java Update to androidx.media3 2021-10-27 09:12:46 +01:00
LoadControl.java Allow associating LoadControl methods with the relevant MediaPeriod. 2023-03-30 17:19:10 +00:00
MediaClock.java Update to androidx.media3 2021-10-27 09:12:46 +01:00
MediaPeriodHolder.java Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
MediaPeriodInfo.java Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
MediaPeriodQueue.java Skip played live ad media periods 2023-03-21 14:20:43 +00:00
MediaSourceInfoHolder.java Update to androidx.media3 2021-10-27 09:12:46 +01:00
MediaSourceList.java Add MediaSource.canUpdateMediaItem/updateMediaItem 2023-07-05 09:21:22 +00:00
MetadataRetriever.java Move TrackGroupArray back to ExoPlayer 2022-03-17 13:08:56 +00:00
NoSampleRenderer.java Use Clock in video renderers 2023-07-13 14:54:10 +01:00
package-info.java Update to androidx.media3 2021-10-27 09:12:46 +01:00
PlaybackInfo.java Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
PlayerMessage.java Annotate methods that always return this with @CanIgnoreReturnValue 2022-08-08 07:55:25 +00:00
PlaylistTimeline.java Fix ArrayIndexOutOfBoundIndex when re-preparing after exception 2023-06-22 15:26:25 +00:00
Renderer.java Use Clock in video renderers 2023-07-13 14:54:10 +01:00
RendererCapabilities.java Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
RendererConfiguration.java Set offload mode preference through TrackSelectionParameters 2023-05-24 16:00:42 +01:00
RenderersFactory.java Update to androidx.media3 2021-10-27 09:12:46 +01:00
SeekParameters.java Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
SimpleExoPlayer.java Rollback of 438ae0ed6a 2023-05-30 14:26:39 +00:00
StandaloneMediaClock.java Migrate callers of deprecated C.java methods to Util.java 2021-11-08 15:17:26 +00:00
StreamVolumeManager.java Extend Player interface, overloading 4 device-volume methods with flags 2023-04-13 16:30:30 +01:00
WakeLockManager.java Update to androidx.media3 2021-10-27 09:12:46 +01:00
WifiLockManager.java Update to androidx.media3 2021-10-27 09:12:46 +01:00