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

Reading the format and/or a sample needs to be done as a single operation. Else you can have a situation where the queue is initially empty, and this happens: 1) Read downstream format X 2) Read downstream format X (unchanged) 3) Write format Y 4) Write first sample 5) Read first sample The first sample then appears to be format X rather than Y. Note that readData in the SampleSource implementations always looks roughly the same. readReset is identical in all cases. isReady is identical in all cases now I've fixed them to be that way. So it should be pretty easy to get DefaultTrackOutput to implement TrackStream directly, at which point a whole load of duplication will disappear. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=120546377