mirror of
https://github.com/androidx/media.git
synced 2025-05-06 23:20:42 +08:00
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
This commit is contained in:
parent
e23392a4fe
commit
5e1b430839
@ -482,13 +482,13 @@ public final class MediaCodecUtil {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer profile = AVC_PROFILE_NUMBER_TO_CONST.get(profileInteger);
|
int profile = AVC_PROFILE_NUMBER_TO_CONST.get(profileInteger, -1);
|
||||||
if (profile == null) {
|
if (profile == -1) {
|
||||||
Log.w(TAG, "Unknown AVC profile: " + profileInteger);
|
Log.w(TAG, "Unknown AVC profile: " + profileInteger);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Integer level = AVC_LEVEL_NUMBER_TO_CONST.get(levelInteger);
|
int level = AVC_LEVEL_NUMBER_TO_CONST.get(levelInteger, -1);
|
||||||
if (level == null) {
|
if (level == -1) {
|
||||||
Log.w(TAG, "Unknown AVC level: " + levelInteger);
|
Log.w(TAG, "Unknown AVC level: " + levelInteger);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user