diff --git a/libraries/common/src/main/java/androidx/media3/common/util/Util.java b/libraries/common/src/main/java/androidx/media3/common/util/Util.java index 698cbcb509..45a408a24e 100644 --- a/libraries/common/src/main/java/androidx/media3/common/util/Util.java +++ b/libraries/common/src/main/java/androidx/media3/common/util/Util.java @@ -1909,6 +1909,8 @@ public final class Util { * @param divisor The divisor. * @return The scaled timestamp. */ + // TODO: b/372204124 - Consider switching this (and impls below) to HALF_UP rounding to reduce + // round-trip errors when switching between time bases with different resolutions. @UnstableApi public static long scaleLargeTimestamp(long timestamp, long multiplier, long divisor) { return scaleLargeValue(timestamp, multiplier, divisor, RoundingMode.DOWN); diff --git a/libraries/muxer/src/main/java/androidx/media3/muxer/Boxes.java b/libraries/muxer/src/main/java/androidx/media3/muxer/Boxes.java index 03f374894a..158a615013 100644 --- a/libraries/muxer/src/main/java/androidx/media3/muxer/Boxes.java +++ b/libraries/muxer/src/main/java/androidx/media3/muxer/Boxes.java @@ -1309,6 +1309,7 @@ import org.checkerframework.checker.nullness.qual.PolyNull; /** Converts video units to microseconds, using the provided timebase. */ private static long usFromVu(long timestampVu, long videoUnitTimebase) { + // TODO: b/372204124 - Switch to scaleLargeTimestamp when it uses HALF_UP rounding. return Util.scaleLargeValue( timestampVu, C.MICROS_PER_SECOND, videoUnitTimebase, RoundingMode.HALF_UP); } @@ -1908,6 +1909,7 @@ import org.checkerframework.checker.nullness.qual.PolyNull; /** Converts microseconds to video units, using the provided timebase. */ private static long vuFromUs(long timestampUs, long videoUnitTimebase) { + // TODO: b/372204124 - Switch to scaleLargeTimestamp when it uses HALF_UP rounding. return Util.scaleLargeValue( timestampUs, videoUnitTimebase, C.MICROS_PER_SECOND, RoundingMode.HALF_UP); }