Fix audio encode timestamp off by one
Simplify the audio encoder input timestamp calculation. The new calculation avoids drifting by tracking the total number of bytes encoded rather than tracking the timestamp and remainder separately, and also makes the timestamps match the decoder output buffer timestamps. Also switch one of the export tests that was passing through AMR samples over to using WAVE audio. The problem with using AMR is that the compressed samples are not necessarily an integer number of audio frames and the shadow decoder would pass them from input to output, so the audio encoder was receiving non-integer numbers of audio frames. Tested by logging the timestamps at the decoder output and encoder input with forcing transcoding audio, and verifying that after this change the audio timestamps are no longer off by one. PiperOrigin-RevId: 523409869
Showing
with
433 additions
and
1695 deletions
Please
register
or
sign in
to comment