Commit 8c07847b by Oliver Woodman

Properly propagate errors that occur during preparation.

parent b501f8ab
......@@ -82,21 +82,23 @@ public class HlsSampleSource implements SampleSource, Loader.Callback {
loader = new Loader("Loader:HLS");
}
continueBufferingInternal();
if (extractors.isEmpty()) {
return false;
}
TsExtractor extractor = extractors.getFirst();
if (extractor.isPrepared()) {
trackCount = extractor.getTrackCount();
trackEnabledStates = new boolean[trackCount];
pendingDiscontinuities = new boolean[trackCount];
downstreamMediaFormats = new MediaFormat[trackCount];
trackInfos = new TrackInfo[trackCount];
for (int i = 0; i < trackCount; i++) {
MediaFormat format = extractor.getFormat(i);
trackInfos[i] = new TrackInfo(format.mimeType, chunkSource.getDurationUs());
if (!extractors.isEmpty()) {
TsExtractor extractor = extractors.getFirst();
if (extractor.isPrepared()) {
trackCount = extractor.getTrackCount();
trackEnabledStates = new boolean[trackCount];
pendingDiscontinuities = new boolean[trackCount];
downstreamMediaFormats = new MediaFormat[trackCount];
trackInfos = new TrackInfo[trackCount];
for (int i = 0; i < trackCount; i++) {
MediaFormat format = extractor.getFormat(i);
trackInfos[i] = new TrackInfo(format.mimeType, chunkSource.getDurationUs());
}
prepared = true;
}
prepared = true;
}
if (!prepared && currentLoadableException != null) {
throw currentLoadableException;
}
return prepared;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment