media/libraries
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
..
cast Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
common Fix inconsistency in SampleQueue seek for sync-sample-only formats 2023-07-13 15:41:49 +01:00
container Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
database Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
datasource Remove unnecessary final on DefaultHttpDataSource.Factory method 2023-06-29 23:09:14 +00:00
datasource_cronet Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
datasource_okhttp Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00:00
datasource_rtmp Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00:00
decoder Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
decoder_av1 Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
decoder_ffmpeg Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
decoder_flac Add more data to e2etest dumps 2023-07-13 15:33:33 +01:00
decoder_midi Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
decoder_opus Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
decoder_vp9 Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
effect Effect: Only allow setExecutorService with @NonNull values. 2023-07-13 15:30:07 +01:00
exoplayer Fix inconsistency in SampleQueue seek for sync-sample-only formats 2023-07-13 15:41:49 +01:00
exoplayer_dash Make MediaItems updateable 2023-07-13 15:26:30 +01:00
exoplayer_hls Make MediaItems updateable 2023-07-13 15:26:30 +01:00
exoplayer_ima Make MediaItems updateable 2023-07-13 15:26:30 +01:00
exoplayer_rtsp Make MediaItems updateable 2023-07-13 15:26:30 +01:00
exoplayer_smoothstreaming Make MediaItems updateable 2023-07-13 15:26:30 +01:00
exoplayer_workmanager Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00:00
extractor Update docs to allow CuesWithTiming.startTimeUs to be C.TIME_UNSET 2023-07-13 15:40:33 +01:00
muxer Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
session Remove javadoc @link from non-javadoc comments 2023-07-13 15:32:21 +01:00
test_data Add more data to e2etest dumps 2023-07-13 15:33:33 +01:00
test_exoplayer_playback Add android.namespace to all build.gradle files 2023-05-19 17:19:15 +01:00
test_session_common Rollback of 7956c80f73 2023-06-19 16:09:13 +01:00
test_session_current Track controllers that don't await the connection 2023-07-13 15:24:12 +01:00
test_utils Add more data to e2etest dumps 2023-07-13 15:33:33 +01:00
test_utils_robolectric Replace deprecated NullableType from checkerframework with our own one 2023-06-19 16:08:20 +01:00
transformer Disable codec tone-mapping on Fold 4 API 33 2023-07-13 15:39:21 +01:00
ui Update build.gradle dependencies for lib-ui tests 2023-07-05 14:01:47 +00:00
ui_leanback Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00:00