mirror of
https://github.com/androidx/media.git
synced 2025-05-16 20:19:57 +08:00

When MediaCodecRenderer is given an empty sample stream, it puts its output format change tracking in a bad state where we never process future stream changes because we are waiting for a sample that doesn't exist. We can fix this by: - Looping the pending output stream changes to see if we processed more than one change at once (this fixes the tracking for empty sample streams that are not the first in the queue). - Checking if none of the previous streams queued any samples in onStreamChanged to handle this in the same way as the case where we already output all samples (this fixes the problem when the empty sample stream comes first in the queue). - Also calling onProcessedStreamChange for the case above, which was missing previously. #minor-release PiperOrigin-RevId: 519226637 (cherry picked from commit b9790e69d7649d3399b9b1f920aa417ba4cc38c1)