andrewlewis 85b61adb32 Call onPrepared/onSourceInfoRefreshed on the playback thread.
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
2016-09-28 11:26:12 +01:00
..
2016-09-28 11:25:02 +01:00