Commit 5e1b4308 by andrewlewis Committed by Andrew Lewis

Fix check for missing profile/level

SparseIntArray.get(key) defaults to zero for missing keys (the null check was
left over from when a Map was used).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=196957452
parent e23392a4
......@@ -482,13 +482,13 @@ public final class MediaCodecUtil {
return null;
}
Integer profile = AVC_PROFILE_NUMBER_TO_CONST.get(profileInteger);
if (profile == null) {
int profile = AVC_PROFILE_NUMBER_TO_CONST.get(profileInteger, -1);
if (profile == -1) {
Log.w(TAG, "Unknown AVC profile: " + profileInteger);
return null;
}
Integer level = AVC_LEVEL_NUMBER_TO_CONST.get(levelInteger);
if (level == null) {
int level = AVC_LEVEL_NUMBER_TO_CONST.get(levelInteger, -1);
if (level == -1) {
Log.w(TAG, "Unknown AVC level: " + levelInteger);
return null;
}
......
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