diff options
author | Elliott Hughes <enh@google.com> | 2014-06-05 11:35:53 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-06-05 11:35:53 -0700 |
commit | 2432912b356dfafd72f8be7b45286a9bc979029e (patch) | |
tree | 9bf6b4fe6800f2807e4dff1243a079229486adb5 /media/jni | |
parent | 29dee1bbba40976f4bb1122d134a0444b0ecb953 (diff) | |
parent | f8272896686cbb3b88dbbd7338a418f72ed2347b (diff) | |
download | frameworks_base-2432912b356dfafd72f8be7b45286a9bc979029e.zip frameworks_base-2432912b356dfafd72f8be7b45286a9bc979029e.tar.gz frameworks_base-2432912b356dfafd72f8be7b45286a9bc979029e.tar.bz2 |
resolved conflicts for merge of f8272896 to master
Change-Id: I34a156bceb5dacd90c399c56c6f07d2a8e5c0c85
Diffstat (limited to 'media/jni')
-rw-r--r-- | media/jni/android_media_MediaScanner.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/media/jni/android_media_MediaScanner.cpp b/media/jni/android_media_MediaScanner.cpp index d21b442..6730e0a 100644 --- a/media/jni/android_media_MediaScanner.cpp +++ b/media/jni/android_media_MediaScanner.cpp @@ -21,6 +21,7 @@ #include <utils/threads.h> #include <media/mediascanner.h> #include <media/stagefright/StagefrightMediaScanner.h> +#include <private/media/VideoFrame.h> #include "jni.h" #include "JNIHelp.h" @@ -347,21 +348,21 @@ android_media_MediaScanner_extractAlbumArt( } int fd = jniGetFDFromFileDescriptor(env, fileDescriptor); - char* data = mp->extractAlbumArt(fd); - if (!data) { + MediaAlbumArt* mediaAlbumArt = + reinterpret_cast<MediaAlbumArt*>(mp->extractAlbumArt(fd)); + if (mediaAlbumArt != NULL) { return NULL; } - jsize len = *((uint32_t*)data); - jbyteArray array = env->NewByteArray(len); + jbyteArray array = env->NewByteArray(mediaAlbumArt->mSize); if (array != NULL) { jbyte* bytes = env->GetByteArrayElements(array, NULL); - memcpy(bytes, data + 4, len); + memcpy(bytes, &mediaAlbumArt->mData[0], mediaAlbumArt->mSize); env->ReleaseByteArrayElements(array, bytes, 0); } done: - free(data); + free(mediaAlbumArt); // if NewByteArray() returned NULL, an out-of-memory // exception will have been raised. I just want to // return null in that case. |