Description[Cast] CastAudioSink audio reference_time adjustment and fixes/clean-up.
This change adds a computation to adjust the reference_time based on the
amount of audio data backlogged in the resampler buffers. In practice,
it seems to offset the timestamp by -20ms, and the performance test
shows this moves overall AV sync almost 20ms closer to zero (good).
A number of bugs and cleanups were also made in this change: 1) Calls to
AudioBus::FromInterleaved() were passing an invalid 3rd argument, which
happened to work because sizeof(int16) == number_of_channels.
2) Possible, yet improbable, FIFO buffer overruns are now checked.
3) Unused members of the CastAudioSink class were removed. 4) The fast,
non-resampling code path is now reachable.
BUG=335335, 437064
Committed: https://crrev.com/1cf451a6580a01a12a3c8bc95d3752e69eb31692
Cr-Commit-Position: refs/heads/master@{#306338}
Patch Set 1 #Patch Set 2 : Replace hacky FIFO size computation with a logical one. #
Total comments: 2
Patch Set 3 : Use loop to pull out all pending data, to prevent FIFO overflow. #Patch Set 4 : Naming tweak. #
Total comments: 2
Patch Set 5 : Simpler loop. #Messages
Total messages: 10 (2 generated)
|