summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/MetadataRetrieverClient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'media/libmediaplayerservice/MetadataRetrieverClient.cpp')
-rw-r--r--media/libmediaplayerservice/MetadataRetrieverClient.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/media/libmediaplayerservice/MetadataRetrieverClient.cpp b/media/libmediaplayerservice/MetadataRetrieverClient.cpp
index f6acdf6..f725b90 100644
--- a/media/libmediaplayerservice/MetadataRetrieverClient.cpp
+++ b/media/libmediaplayerservice/MetadataRetrieverClient.cpp
@@ -19,6 +19,7 @@
#define LOG_TAG "MetadataRetrieverClient"
#include <utils/Log.h>
+#include <inttypes.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
@@ -84,7 +85,6 @@ static sp<MediaMetadataRetrieverBase> createRetriever(player_type playerType)
{
sp<MediaMetadataRetrieverBase> p;
switch (playerType) {
- case STAGEFRIGHT_PLAYER:
case NU_PLAYER:
{
p = new StagefrightMetadataRetriever;
@@ -133,7 +133,7 @@ status_t MetadataRetrieverClient::setDataSource(
status_t MetadataRetrieverClient::setDataSource(int fd, int64_t offset, int64_t length)
{
- ALOGV("setDataSource fd=%d, offset=%lld, length=%lld", fd, offset, length);
+ ALOGV("setDataSource fd=%d, offset=%" PRId64 ", length=%" PRId64 "", fd, offset, length);
Mutex::Autolock lock(mLock);
struct stat sb;
int ret = fstat(fd, &sb);
@@ -141,20 +141,19 @@ status_t MetadataRetrieverClient::setDataSource(int fd, int64_t offset, int64_t
ALOGE("fstat(%d) failed: %d, %s", fd, ret, strerror(errno));
return BAD_VALUE;
}
- ALOGV("st_dev = %llu", static_cast<uint64_t>(sb.st_dev));
+ ALOGV("st_dev = %" PRIu64 "", static_cast<uint64_t>(sb.st_dev));
ALOGV("st_mode = %u", sb.st_mode);
ALOGV("st_uid = %lu", static_cast<unsigned long>(sb.st_uid));
ALOGV("st_gid = %lu", static_cast<unsigned long>(sb.st_gid));
- ALOGV("st_size = %llu", sb.st_size);
+ ALOGV("st_size = %" PRIu64 "", sb.st_size);
if (offset >= sb.st_size) {
- ALOGE("offset (%lld) bigger than file size (%llu)", offset, sb.st_size);
- ::close(fd);
+ ALOGE("offset (%" PRId64 ") bigger than file size (%" PRIu64 ")", offset, sb.st_size);
return BAD_VALUE;
}
if (offset + length > sb.st_size) {
length = sb.st_size - offset;
- ALOGV("calculated length = %lld", length);
+ ALOGV("calculated length = %" PRId64 "", length);
}
player_type playerType =
@@ -165,12 +164,10 @@ status_t MetadataRetrieverClient::setDataSource(int fd, int64_t offset, int64_t
ALOGV("player type = %d", playerType);
sp<MediaMetadataRetrieverBase> p = createRetriever(playerType);
if (p == NULL) {
- ::close(fd);
return NO_INIT;
}
status_t status = p->setDataSource(fd, offset, length);
if (status == NO_ERROR) mRetriever = p;
- ::close(fd);
return status;
}
@@ -195,7 +192,7 @@ Mutex MetadataRetrieverClient::sLock;
sp<IMemory> MetadataRetrieverClient::getFrameAtTime(int64_t timeUs, int option)
{
- ALOGV("getFrameAtTime: time(%lld us) option(%d)", timeUs, option);
+ ALOGV("getFrameAtTime: time(%" PRId64 " us) option(%d)", timeUs, option);
Mutex::Autolock lock(mLock);
Mutex::Autolock glock(sLock);
mThumbnail.clear();
@@ -217,7 +214,7 @@ sp<IMemory> MetadataRetrieverClient::getFrameAtTime(int64_t timeUs, int option)
}
mThumbnail = new MemoryBase(heap, 0, size);
if (mThumbnail == NULL) {
- ALOGE("not enough memory for VideoFrame size=%u", size);
+ ALOGE("not enough memory for VideoFrame size=%zu", size);
delete frame;
return NULL;
}
@@ -259,7 +256,7 @@ sp<IMemory> MetadataRetrieverClient::extractAlbumArt()
}
mAlbumArt = new MemoryBase(heap, 0, size);
if (mAlbumArt == NULL) {
- ALOGE("not enough memory for MediaAlbumArt size=%u", size);
+ ALOGE("not enough memory for MediaAlbumArt size=%zu", size);
delete albumArt;
return NULL;
}