media/libraries
tonihei a9be9caf40 Ensure SampleQueue seek only happens if needed
When selecting progressive and HLS tracks, we currently check if
we can either seek in the existing samples or are starting from the
beginning of the stream. In both cases, we don't need to reload the
stream and can continue reading.

Seeking to the beginning isn't side-effect free though because it
also sets the startTimeUs to zero. Whether a seek to the beginning
is successful also depends on whether we already loaded a sample or
not. This mean that the startTimeUs value is set (or not set) based
on the speed of the Loader thread even for the same input starting
from the beginning. This race condition means the actual samples
we write to the stream may differ if the stream has initial samples
with negative timestamps.

We can avoid this race condition by checking if the queue is empty
first, so that we only call seekTo if really needed.

PiperOrigin-RevId: 546010951
2023-07-13 15:08:27 +01:00
..
cast Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
common Remove stale TODO 2023-07-13 14:55:23 +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 Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00: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 Fix stale javadoc 2023-07-13 15:07:17 +01:00
exoplayer Ensure SampleQueue seek only happens if needed 2023-07-13 15:08:27 +01:00
exoplayer_dash Merge pull request #487 from vishnuchilakala:allow_unsigned_int_for_adaptation_set_id 2023-07-05 08:53:09 +00:00
exoplayer_hls Ensure SampleQueue seek only happens if needed 2023-07-13 15:08:27 +01:00
exoplayer_ima Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
exoplayer_rtsp Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
exoplayer_smoothstreaming Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
exoplayer_workmanager Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00:00
extractor Update TODO link for shrinking workaround in DefaultExtractorsFactory 2023-07-13 15:02:33 +01:00
muxer Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
session Suppress NewApi lint warning on <vector> usage in drawables 2023-07-05 09:08:51 +00:00
test_data Include timing info in some SCTE-35 toString implementations 2023-07-05 09:18:00 +00: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 Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
test_utils Effect: Remove GlTextureInfo accessor methods. 2023-07-13 14:51:38 +01:00
test_utils_robolectric Replace deprecated NullableType from checkerframework with our own one 2023-06-19 16:08:20 +01:00
transformer Rename SamplePipeline to SampleExporter 2023-07-13 15:06:10 +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