Fix division by zero in MuxerWrapper

PiperOrigin-RevId: 653644998
This commit is contained in:
dancho 2024-07-18 09:16:12 -07:00 committed by Copybara-Service
parent 1cbcd20851
commit f8bdb7e59f

View File

@ -798,7 +798,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* there is no track data.
*/
public int getAverageBitrate() {
if (timeUs <= 0 || bytesWritten <= 0) {
if (timeUs <= 0 || bytesWritten <= 0 || timeUs == startTimeUs) {
return C.RATE_UNSET_INT;
}