Commit 57faa497 by Oliver Woodman

Fix crash running ExoPlayer demo on JB. My bad!

- We can't refer to UnsupportedSchemeException outside of the
V18 compat inner classes.
- There were also a few missing return; calls.
parent 11eb1c22
......@@ -163,12 +163,8 @@ public class DashRendererBuilder implements RendererBuilder,
// HD streams require L1 security.
filterHdContent = videoAdaptationSet != null && videoAdaptationSet.hasContentProtection()
&& !drmSessionManagerData.second;
} catch (UnsupportedSchemeException e) {
callback.onRenderersError(
new UnsupportedDrmException(UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME, e));
} catch (Exception e) {
callback.onRenderersError(
new UnsupportedDrmException(UnsupportedDrmException.REASON_UNKNOWN, e));
} catch (UnsupportedDrmException e) {
callback.onRenderersError(e);
return;
}
}
......@@ -328,12 +324,18 @@ public class DashRendererBuilder implements RendererBuilder,
private static class V18Compat {
public static Pair<DrmSessionManager, Boolean> getDrmSessionManagerData(DemoPlayer player,
MediaDrmCallback drmCallback) throws UnsupportedSchemeException {
StreamingDrmSessionManager streamingDrmSessionManager = new StreamingDrmSessionManager(
DemoUtil.WIDEVINE_UUID, player.getPlaybackLooper(), drmCallback, null,
player.getMainHandler(), player);
return Pair.create((DrmSessionManager) streamingDrmSessionManager,
getWidevineSecurityLevel(streamingDrmSessionManager) == SECURITY_LEVEL_1);
MediaDrmCallback drmCallback) throws UnsupportedDrmException {
try {
StreamingDrmSessionManager streamingDrmSessionManager = new StreamingDrmSessionManager(
DemoUtil.WIDEVINE_UUID, player.getPlaybackLooper(), drmCallback, null,
player.getMainHandler(), player);
return Pair.create((DrmSessionManager) streamingDrmSessionManager,
getWidevineSecurityLevel(streamingDrmSessionManager) == SECURITY_LEVEL_1);
} catch (UnsupportedSchemeException e) {
throw new UnsupportedDrmException(UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME);
} catch (Exception e) {
throw new UnsupportedDrmException(UnsupportedDrmException.REASON_UNKNOWN, e);
}
}
private static int getWidevineSecurityLevel(StreamingDrmSessionManager sessionManager) {
......
......@@ -118,12 +118,8 @@ public class SmoothStreamingRendererBuilder implements RendererBuilder,
try {
drmSessionManager = V18Compat.getDrmSessionManager(manifest.protectionElement.uuid, player,
drmCallback);
} catch (UnsupportedSchemeException e) {
callback.onRenderersError(
new UnsupportedDrmException(UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME, e));
} catch (Exception e) {
callback.onRenderersError(
new UnsupportedDrmException(UnsupportedDrmException.REASON_UNKNOWN, e));
} catch (UnsupportedDrmException e) {
callback.onRenderersError(e);
return;
}
}
......@@ -259,9 +255,15 @@ public class SmoothStreamingRendererBuilder implements RendererBuilder,
private static class V18Compat {
public static DrmSessionManager getDrmSessionManager(UUID uuid, DemoPlayer player,
MediaDrmCallback drmCallback) throws UnsupportedSchemeException {
return new StreamingDrmSessionManager(uuid, player.getPlaybackLooper(), drmCallback, null,
player.getMainHandler(), player);
MediaDrmCallback drmCallback) throws UnsupportedDrmException {
try {
return new StreamingDrmSessionManager(uuid, player.getPlaybackLooper(), drmCallback, null,
player.getMainHandler(), player);
} catch (UnsupportedSchemeException e) {
throw new UnsupportedDrmException(UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME);
} catch (Exception e) {
throw new UnsupportedDrmException(UnsupportedDrmException.REASON_UNKNOWN, e);
}
}
}
......
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