summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--media/libmedia/ToneGenerator.cpp4
-rw-r--r--media/libstagefright/matroska/MatroskaExtractor.cpp4
-rw-r--r--media/mtp/MtpServer.cpp3
3 files changed, 6 insertions, 5 deletions
diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp
index 9ea3ea7..f09ce75 100644
--- a/media/libmedia/ToneGenerator.cpp
+++ b/media/libmedia/ToneGenerator.cpp
@@ -986,7 +986,7 @@ void ToneGenerator::stopTone() {
// If the start time is valid, make sure that the number of audio samples produced
// corresponds at least to the time between the start and stop commands.
// This is needed in case of cold start of the output stream.
- if ((mStartTime. tv_sec != 0) && (clock_gettime(CLOCK_MONOTONIC, &stopTime) == 0)) {
+ if ((mStartTime.tv_sec != 0) && (clock_gettime(CLOCK_MONOTONIC, &stopTime) == 0)) {
time_t sec = stopTime.tv_sec - mStartTime.tv_sec;
long nsec = stopTime.tv_nsec - mStartTime.tv_nsec;
long durationMs;
@@ -1000,7 +1000,7 @@ void ToneGenerator::stopTone() {
} else {
// mSamplingRate is always > 1000
sec = sec * 1000 + nsec / 1000000; // duration in milliseconds
- mMaxSmp = (sec * mSamplingRate) / 1000;
+ mMaxSmp = (unsigned int)(((int64_t)sec * mSamplingRate) / 1000);
}
ALOGV("stopTone() forcing mMaxSmp to %d, total for far %d", mMaxSmp, mTotalSmp);
} else {
diff --git a/media/libstagefright/matroska/MatroskaExtractor.cpp b/media/libstagefright/matroska/MatroskaExtractor.cpp
index 7fc7037..b304749 100644
--- a/media/libstagefright/matroska/MatroskaExtractor.cpp
+++ b/media/libstagefright/matroska/MatroskaExtractor.cpp
@@ -263,8 +263,8 @@ void BlockIterator::advance_l() {
mCluster, nextCluster, pos, len);
ALOGV("ParseNext returned %ld", res);
- if (res > 0) {
- // EOF
+ if (res != 0) {
+ // EOF or error
mCluster = NULL;
break;
diff --git a/media/mtp/MtpServer.cpp b/media/mtp/MtpServer.cpp
index 8568dfc..df87db4 100644
--- a/media/mtp/MtpServer.cpp
+++ b/media/mtp/MtpServer.cpp
@@ -704,7 +704,8 @@ MtpResponseCode MtpServer::doGetObjectInfo() {
mData.putUInt32(info.mAssociationDesc);
mData.putUInt32(info.mSequenceNumber);
mData.putString(info.mName);
- mData.putEmptyString(); // date created
+ formatDateTime(info.mDateCreated, date, sizeof(date));
+ mData.putString(date); // date created
formatDateTime(info.mDateModified, date, sizeof(date));
mData.putString(date); // date modified
mData.putEmptyString(); // keywords