media/libraries
ibaker 7e58fde18e 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))`).

Issue: androidx/media#538
PiperOrigin-RevId: 554481782
(cherry picked from commit 6e91f0d4c5)
2023-08-07 15:17:31 +00:00
..
cast Implement Player.replaceMediaItem(s) 2023-05-26 13:25:10 +00:00
common Use ceiling divide logic in AudioTrackPositionTracker.hasPendingData 2023-08-07 15:17:31 +00:00
container Fix parsing of H.265 sequence parameter sets 2023-07-28 16:00:13 +01:00
database Fix javadoc links in media README files 2023-03-30 17:26:40 +00:00
datasource Fix missing equals sign in inline-comment parameter names 2023-06-22 16:09:57 +00:00
datasource_cronet Fix missing equals sign in inline-comment parameter names 2023-06-22 16:09:57 +00:00
datasource_okhttp Fix javadoc links in media README files 2023-03-30 17:26:40 +00:00
datasource_rtmp Fix javadoc links in media README files 2023-03-30 17:26:40 +00:00
decoder Update dependencies to latest versions 2023-04-26 15:49:57 +01:00
decoder_av1 Remove Javadoc TODO from README of decoder extensions 2023-04-05 15:48:58 +01:00
decoder_ffmpeg Remove FfmpegVideoRenderer from 1.1.0 release 2023-05-18 18:04:45 +00:00
decoder_flac Update dependencies to latest versions 2023-04-26 15:49:57 +01:00
decoder_opus Update dependencies to latest versions 2023-04-26 15:49:57 +01:00
decoder_vp9 Update dependencies to latest versions 2023-04-26 15:49:57 +01:00
effect Rollback of a66f08ba97 2023-06-12 09:15:55 +00:00
exoplayer Use ceiling divide logic in AudioTrackPositionTracker.hasPendingData 2023-08-07 15:17:31 +00:00
exoplayer_dash Simplify and accurately compute chunk duration 2023-08-01 16:48:19 +00:00
exoplayer_hls Simplify and accurately compute chunk duration 2023-08-01 16:48:19 +00:00
exoplayer_ima Fix splitting ad playback state for partial ad group when joining 2023-06-12 09:15:54 +00:00
exoplayer_rtsp Use base Uri from the RTSP DESCRIBE response header for relative paths 2023-05-26 13:25:10 +00:00
exoplayer_smoothstreaming Simplify and accurately compute chunk duration 2023-08-01 16:48:19 +00:00
exoplayer_workmanager Remove deprecated WorkManagerScheduler constructor 2023-05-18 16:07:51 +00:00
extractor Add comment about out-of-order timestamps in AtomParsers.parseStbl 2023-07-24 18:05:04 +01:00
muxer Enable nullness checker for Muxer module androidTest library 2023-06-12 09:15:53 +00:00
session Only use result.sendError where supported by legacy media library 2023-07-26 16:14:39 +01:00
test_data Prepend Ogg ID and Comment Header Pages to offloaded Opus stream 2023-07-14 11:41:56 +01:00
test_exoplayer_playback Update dependencies to latest versions 2023-04-26 15:49:57 +01:00
test_session_common Add custom layout to the state of the MediaController 2023-07-11 20:59:01 +01:00
test_session_current Only use result.sendError where supported by legacy media library 2023-07-26 16:14:39 +01:00
test_utils Add nanoTime method to Clock to support overriding System.nanoTime() 2023-07-03 16:29:13 +00:00
test_utils_robolectric Move MdtaMetadataEntry class into container module 2023-05-26 13:25:07 +00:00
transformer Factor out video decoding and fix two minor issues 2023-06-12 11:05:08 +00:00
ui Check command availability before getting tracks in PlayerView 2023-08-07 13:01:49 +00:00
ui_leanback Use Util method for common UI play/pause button logic. 2023-04-26 15:52:50 +01:00