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

HlsSampleStreamWrapper and ExtractorMediaPeriod would call onPrepared/onSourceInfoRefreshed from their loading threads. That was problematic for ConcatenatingMediaSource and MergingMediaSource, which assume that their callbacks are called on the same thread (iterating through timelines from all sources and updating pendingTimelineSources respectively). This change makes them post calls to the callbacks on the playback thread. Generally, implementing a composite MediaSource is easier if MediaPeriod.Callback's methods are all called on the same (playback) thread, so this change makes that part of its contract. Also post onContinueLoadingRequested from ExtractingLoadable because MergingMediaPeriod.onContinueLoadingRequested reads trackGroups written on the playback thread. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=134407280