summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2009-10-12 16:24:46 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2009-10-12 16:24:46 -0700
commitc55bb59e542368500937d6737ce2ea2d3524d6d7 (patch)
tree1f71c6250262b0916fb0d576a006d9ad2ef771d4 /cmds
parent4fce5c81d5b166920c60d4a907e581c71c215858 (diff)
parentef703f60d5c00527048fdaf1c24984762f6fd434 (diff)
downloadframeworks_base-c55bb59e542368500937d6737ce2ea2d3524d6d7.zip
frameworks_base-c55bb59e542368500937d6737ce2ea2d3524d6d7.tar.gz
frameworks_base-c55bb59e542368500937d6737ce2ea2d3524d6d7.tar.bz2
am ef703f60: Merge change I98276091 into eclair-mr2
Merge commit 'ef703f60d5c00527048fdaf1c24984762f6fd434' into eclair-mr2-plus-aosp * commit 'ef703f60d5c00527048fdaf1c24984762f6fd434': Change to a int64_t usecs representation for timestamps and duration throughout stagefright.
Diffstat (limited to 'cmds')
-rw-r--r--cmds/stagefright/SineSource.cpp4
-rw-r--r--cmds/stagefright/stagefright.cpp10
2 files changed, 6 insertions, 8 deletions
diff --git a/cmds/stagefright/SineSource.cpp b/cmds/stagefright/SineSource.cpp
index e5a6ccb..e272a65 100644
--- a/cmds/stagefright/SineSource.cpp
+++ b/cmds/stagefright/SineSource.cpp
@@ -86,8 +86,8 @@ status_t SineSource::read(
x += k;
}
- buffer->meta_data()->setInt32(kKeyTimeUnits, mPhase);
- buffer->meta_data()->setInt32(kKeyTimeScale, mSampleRate);
+ buffer->meta_data()->setInt64(
+ kKeyTime, ((int64_t)mPhase * 1000000) / mSampleRate);
mPhase += numFramesPerBuffer;
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp
index 5397a69..6674620 100644
--- a/cmds/stagefright/stagefright.cpp
+++ b/cmds/stagefright/stagefright.cpp
@@ -76,14 +76,12 @@ static void playSource(OMXClient *client, const sp<MediaSource> &source) {
shouldSeek = true;
} else {
- int32_t units, scale;
- CHECK(buffer->meta_data()->findInt32(kKeyTimeUnits, &units));
- CHECK(buffer->meta_data()->findInt32(kKeyTimeScale, &scale));
- int64_t timestamp = ((OMX_TICKS)units * 1000000) / scale;
+ int64_t timestampUs;
+ CHECK(buffer->meta_data()->findInt64(kKeyTime, &timestampUs));
bool failed = false;
if (seekTimeUs >= 0) {
- int64_t diff = timestamp - seekTimeUs;
+ int64_t diff = timestampUs - seekTimeUs;
if (diff > 500000) {
printf("ERROR: ");
@@ -92,7 +90,7 @@ static void playSource(OMXClient *client, const sp<MediaSource> &source) {
}
printf("buffer has timestamp %lld us (%.2f secs)\n",
- timestamp, timestamp / 1E6);
+ timestampUs, timestampUs / 1E6);
buffer->release();
buffer = NULL;