Merge "The presence of the kKeyAACProfile is optional, we should not mandate its presence in AACWriter." into jb-dev
diff --git a/media/libstagefright/AACWriter.cpp b/media/libstagefright/AACWriter.cpp
index 21c5428..284ba01 100644
--- a/media/libstagefright/AACWriter.cpp
+++ b/media/libstagefright/AACWriter.cpp
@@ -98,9 +98,13 @@
     CHECK(!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC));
     CHECK(meta->findInt32(kKeyChannelCount, &mChannelCount));
     CHECK(meta->findInt32(kKeySampleRate, &mSampleRate));
-    CHECK(meta->findInt32(kKeyAACProfile, &mAACProfile));
     CHECK(mChannelCount >= 1 && mChannelCount <= 2);
 
+    // Optionally, we want to check whether AACProfile is also set.
+    if (meta->findInt32(kKeyAACProfile, &mAACProfile)) {
+        ALOGI("AAC profile is changed to %d", mAACProfile);
+    }
+
     mSource = source;
     return OK;
 }