There are two AV sync issues:
1. Video is ahead of audio. When playback starts, we will push the first audio frame to render right away. But it does not mean the audio will be heard immediately. There could be buffering, audio post-processing, etc. that would introduce extra audio delay.
2. Video playback lags audio as time goes if video decoder is too slow for certain frames. If video is lagging audio, whenever an video frame is decoded, we immediately call releaseOutput() to render the video frame. MediaCodec.ReleseOutput() is a non blocking call, so it will immediately return and cast should schedule enqueue and dequeue a new frame.
Since the video lag is introduced by decoding, rather than rendering, unless we can skip decoding a frame, or otherwise it won't help.
Please check b/27246165 and b/27048783 for more contexts.
Comment 1 by yini...@chromium.org
, Mar 28 2016