Fail fast if we can't play anything.

Issue: #672
This commit is contained in:
Oliver Woodman 2015-07-30 20:34:17 +01:00
parent ed51b58242
commit 1a5d12359d

View File

@ -146,6 +146,11 @@ public class HlsRendererBuilder implements RendererBuilder {
} }
} }
if (variantIndices.length == 0) {
player.onRenderersError(new IllegalStateException("No variants selected."));
return;
}
DataSource dataSource = new DefaultUriDataSource(context, bandwidthMeter, userAgent); DataSource dataSource = new DefaultUriDataSource(context, bandwidthMeter, userAgent);
HlsChunkSource chunkSource = new HlsChunkSource(dataSource, url, manifest, bandwidthMeter, HlsChunkSource chunkSource = new HlsChunkSource(dataSource, url, manifest, bandwidthMeter,
variantIndices, HlsChunkSource.ADAPTIVE_MODE_SPLICE, audioCapabilities); variantIndices, HlsChunkSource.ADAPTIVE_MODE_SPLICE, audioCapabilities);