mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00

It was possible for a codec input buffer to be filled with two frames' worth of data, if seekTo was called after populating a buffer, if waitingForKeys was true and seeking did not trigger a flush. This caused the CryptoInfo to be configured as if the input buffer contained a large amount of reconfiguration data as cleartext. Move resetting waitingForKeys to flushCodec, so that we don't try to read the next sample from the source until the first one has been consumed or discarded.