This fixes a bug with playing very short audio files, introduced by https://github.com/google/ExoPlayer/commit/fe710871aad3e4e6b4e0798f1cf762d5ecfebedb 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 a9a2451ccbd08649da20936407076681fe3ad40f)
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| all | Loading commit data... | |
| common | Loading commit data... | |
| container | Loading commit data... | |
| core | Loading commit data... | |
| dash | Loading commit data... | |
| database | Loading commit data... | |
| datasource | Loading commit data... | |
| decoder | Loading commit data... | |
| effect | Loading commit data... | |
| extractor | Loading commit data... | |
| hls | Loading commit data... | |
| muxer | Loading commit data... | |
| rtsp | Loading commit data... | |
| smoothstreaming | Loading commit data... | |
| transformer | Loading commit data... | |
| ui | Loading commit data... | |
| README.md | Loading commit data... |