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 { ...@@ -82,21 +82,23 @@ public class HlsSampleSource implements SampleSource, Loader.Callback {
loader = new Loader("Loader:HLS"); loader = new Loader("Loader:HLS");
} }
continueBufferingInternal(); continueBufferingInternal();
if (extractors.isEmpty()) { if (!extractors.isEmpty()) {
return false; TsExtractor extractor = extractors.getFirst();
} if (extractor.isPrepared()) {
TsExtractor extractor = extractors.getFirst(); trackCount = extractor.getTrackCount();
if (extractor.isPrepared()) { trackEnabledStates = new boolean[trackCount];
trackCount = extractor.getTrackCount(); pendingDiscontinuities = new boolean[trackCount];
trackEnabledStates = new boolean[trackCount]; downstreamMediaFormats = new MediaFormat[trackCount];
pendingDiscontinuities = new boolean[trackCount]; trackInfos = new TrackInfo[trackCount];
downstreamMediaFormats = new MediaFormat[trackCount]; for (int i = 0; i < trackCount; i++) {
trackInfos = new TrackInfo[trackCount]; MediaFormat format = extractor.getFormat(i);
for (int i = 0; i < trackCount; i++) { trackInfos[i] = new TrackInfo(format.mimeType, chunkSource.getDurationUs());
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; 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