Fix AMediaExtractor_getSampleCryptoInfo returning iv as key.
There is a typo such that iv is returned as the crypto key in
the AMediaCodecCryptoInfo object.
kKeyCryptoKey should replace kKeyCryptoIV when searching for
the crypto key in the meta data.
bug: 31158746
Change-Id: I68c266b69fdb801b2b1182bbffe9a31cab7be6ce
diff --git a/media/ndk/NdkMediaExtractor.cpp b/media/ndk/NdkMediaExtractor.cpp
index 1118959..face727 100644
--- a/media/ndk/NdkMediaExtractor.cpp
+++ b/media/ndk/NdkMediaExtractor.cpp
@@ -343,9 +343,9 @@
const void *key;
size_t keysize;
- if (meta->findData(kKeyCryptoIV, &type, &key, &keysize)) {
+ if (meta->findData(kKeyCryptoKey, &type, &key, &keysize)) {
if (keysize != 16) {
- // IVs must be 16 bytes in length.
+ // Keys must be 16 bytes in length.
return NULL;
}
}