Commit 14b85712 authored by Felix Abecassis's avatar Felix Abecassis

mediacodec: check exceptions after getCapabilitiesForType()

Avoid crashing on some devices, but it forces fallback to SW decoding.
parent f90e9ebc
...@@ -388,7 +388,11 @@ static int OpenDecoder(vlc_object_t *p_this) ...@@ -388,7 +388,11 @@ static int OpenDecoder(vlc_object_t *p_this)
(*env)->NewStringUTF(env, mime)); (*env)->NewStringUTF(env, mime));
jobject profile_levels = NULL; jobject profile_levels = NULL;
int profile_levels_len = 0; int profile_levels_len = 0;
if (codec_capabilities) { if ((*env)->ExceptionOccurred(env)) {
msg_Warn(p_dec, "Exception occurred in MediaCodecInfo.getCapabilitiesForType");
(*env)->ExceptionClear(env);
break;
} else if (codec_capabilities) {
profile_levels = (*env)->GetObjectField(env, codec_capabilities, p_sys->profile_levels_field); profile_levels = (*env)->GetObjectField(env, codec_capabilities, p_sys->profile_levels_field);
if (profile_levels) if (profile_levels)
profile_levels_len = (*env)->GetArrayLength(env, profile_levels); profile_levels_len = (*env)->GetArrayLength(env, profile_levels);
......
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 to comment