Fix edge case in HlsSampleSource.

1. prepare() needs to load a TsChunk to actually prepare the source.
2. Source is prepared, but no tracks are enabled (this is why it's
   an edge case - no-one is likely to be doing this!).
3. The TsChunk load completes.

We should not load additional chunks in this case.
This commit is contained in:
Oliver Woodman 2015-05-11 21:02:38 +01:00
parent dd5eabdf4a
commit 770ad7f06f

View File

@ -345,7 +345,12 @@ public class HlsSampleSource implements SampleSource, Loader.Callback {
if (!currentLoadableExceptionFatal) { if (!currentLoadableExceptionFatal) {
clearCurrentLoadable(); clearCurrentLoadable();
} }
maybeStartLoading(); if (enabledTrackCount > 0) {
maybeStartLoading();
} else {
clearState();
allocator.trim(0);
}
} }
@Override @Override