media/libraries
ibaker 885ddb167e Add general-purpose overflow-resistant divide+multiply util method
This is equivalent to the existing `scaleLargeTimestamp` method with the
following changes/improvements:
* No longer specific to timestamps (there was nothing inherently
  time-specific about the logic in `scaleLargeTimestamp`, but the name
  and docs suggested it shouldn't be used for non-timestamp use-cases).
* Additional 'perfect division' checks between `value` and `divisor`.
* The caller can now provide a `RoundingMode`.
* Robust against `multiplier == 0`.
* Some extra branches before falling through to (potentially lossy)
  floating-point math, including trying to simplify the fraction with
  greatest common divisor to reduce the chance of overflowing `long`.

This was discussed during review of 6e91f0d4c5

This change also includes some golden test file updates - these
represent a bug fix where floating-point maths had previously resulted
in a timestamp being incorrectly rounded down to the previous
microsecond. These changes are due to the 'some more branches' mentioned
above.

PiperOrigin-RevId: 564760748
2023-09-12 10:22:57 -07:00
..
cast Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
common Add general-purpose overflow-resistant divide+multiply util method 2023-09-12 10:22:57 -07:00
container Remove duplication of various TestUtil methods 2023-08-31 08:23:33 -07:00
database Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
datasource Add nullness annotations to SimpleCache 2023-08-22 15:33:08 +01: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 Implement MultipleInputVideoGraph 2023-09-12 09:45:23 -07:00
exoplayer Allow renderer recovery with disabling offload if failed at first write 2023-09-11 09:04:17 -07:00
exoplayer_dash Add functionality to transmit CMCD data using query parameters 2023-08-31 02:11:12 -07:00
exoplayer_hls Add functionality to transmit CMCD data using query parameters 2023-08-31 02:11:12 -07:00
exoplayer_ima Add StreamEventListener for IMA SSAI source 2023-08-31 11:29:29 -07:00
exoplayer_rtsp Added condition to RtspMediaPeriod.isLoading to check RtspState 2023-08-30 06:29:53 -07:00
exoplayer_smoothstreaming Add functionality to transmit CMCD data using query parameters 2023-08-31 02:11:12 -07:00
exoplayer_workmanager Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00:00
extractor Add general-purpose overflow-resistant divide+multiply util method 2023-09-12 10:22:57 -07:00
muxer Make sure the mdat box is not extended by more than 1 GB at a time. 2023-09-08 04:07:13 -07:00
session Use media button broadcast receiver above Android 31 2023-09-05 14:24:06 -07:00
test_data Add general-purpose overflow-resistant divide+multiply util method 2023-09-12 10:22:57 -07:00
test_exoplayer_playback Add android.namespace to all build.gradle files 2023-05-19 17:19:15 +01:00
test_session_common Show play button during playback suppression by default 2023-08-15 17:15:38 +01:00
test_session_current Session tests: Log when no controllers are connected 2023-09-12 09:52:21 -07:00
test_utils Rollback of 51fd06482b 2023-09-08 04:39:51 -07: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 Implement MultipleInputVideoGraph 2023-09-12 09:45:23 -07:00
ui Deprecate multi-window time bar mode 2023-09-08 04:46:43 -07:00
ui_leanback Prevent forwarding of zero video size to Leanback 2023-08-30 12:20:51 -07:00