media/libraries
ibaker 6e91f0d4c5 Use ceiling divide logic in AudioTrackPositionTracker.hasPendingData
This fixes a bug with playing very short audio files, introduced by
fe710871aa

The existing code using floor integer division results in playback never
transitioning to `STATE_ENDED` because at the end of playback for the
short sample clip provided `currentPositionUs=189937`,
`outputSampleRate=16000` and `(189937 * 16000) / 1000000 = 3038.992`,
while `writtenFrames=3039`. This is fixed by using `Util.ceilDivide`
so we return `3039`, which means
`AudioTrackPositionTracker.hasPendingData()` returns `false` (since
`writtenFrames ==
durationUsToFrames(getCurrentPositionUs(/* sourceEnded= */ false))`).

#minor-release

Issue: androidx/media#538
PiperOrigin-RevId: 554481782
2023-08-10 11:57:15 +00:00
..
cast Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
common Use ceiling divide logic in AudioTrackPositionTracker.hasPendingData 2023-08-10 11:57:15 +00:00
container Fix parsing of H.265 sequence parameter sets 2023-08-01 14:22:29 +01: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 Test: Generalize Compositor tests for multi-input, and add more tests. 2023-08-07 11:32:38 +00:00
exoplayer Use ceiling divide logic in AudioTrackPositionTracker.hasPendingData 2023-08-10 11:57:15 +00:00
exoplayer_dash Simplify and accurately compute chunk duration 2023-08-07 11:19:00 +00:00
exoplayer_hls Simplify and accurately compute chunk duration 2023-08-07 11:19:00 +00:00
exoplayer_ima Make MediaItems updateable 2023-07-13 15:26:30 +01:00
exoplayer_rtsp Remove stale TODO 2023-08-01 14:14:34 +01:00
exoplayer_smoothstreaming Simplify and accurately compute chunk duration 2023-08-07 11:19:00 +00:00
exoplayer_workmanager Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00:00
extractor Create SingleSampleSeekMap and use in pngExtractor 2023-08-07 11:27:27 +00:00
muxer Add validation for empty csd data 2023-08-01 14:34:17 +01:00
session Only use result.sendError where supported by legacy media library 2023-08-01 14:11:08 +01:00
test_data Reset loading period after reading discontinuity that requires loading 2023-08-07 11:30:38 +00:00
test_exoplayer_playback Add android.namespace to all build.gradle files 2023-05-19 17:19:15 +01:00
test_session_common Use MediaUtils.intersect in MediaControllerImplBase 2023-08-01 13:54:11 +01:00
test_session_current Only use result.sendError where supported by legacy media library 2023-08-01 14:11:08 +01:00
test_utils Use a larger pixel difference on real devices 2023-08-07 14:04:36 +00:00
test_utils_robolectric Set signal on renderer once it's allowed to render start of stream 2023-07-13 15:59:00 +01:00
transformer Use specific type for SequenceAssetLoader internal logic. 2023-08-07 11:36:43 +00:00
ui Check command availability before getting tracks in PlayerView 2023-08-07 14:03:27 +00:00
ui_leanback Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00:00