diff options
author | Andreas Huber <andih@google.com> | 2009-10-16 15:55:33 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-10-16 15:55:33 -0700 |
commit | 36ad2c62b0fd5f91324f122355e355198ca56edf (patch) | |
tree | 31c8a8745829caa7727a62d4d130771d45204c5e /cmds | |
parent | c2f945c047496584f4fdc6b4c76653f6c628c951 (diff) | |
parent | 1705d87b7e576bcd3bdc670411511376b4e245c5 (diff) | |
download | frameworks_base-36ad2c62b0fd5f91324f122355e355198ca56edf.zip frameworks_base-36ad2c62b0fd5f91324f122355e355198ca56edf.tar.gz frameworks_base-36ad2c62b0fd5f91324f122355e355198ca56edf.tar.bz2 |
am 1705d87b: am bfea1e13: resolved conflicts for merge of f585be7f to eclair-mr2
Merge commit '1705d87b7e576bcd3bdc670411511376b4e245c5'
* commit '1705d87b7e576bcd3bdc670411511376b4e245c5':
A few more testcases for the vendor to reproduce issues with their decoder. Not part of the shipping image.
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/stagefright/stagefright.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp index 7dc99c1..3b7cece 100644 --- a/cmds/stagefright/stagefright.cpp +++ b/cmds/stagefright/stagefright.cpp @@ -52,6 +52,9 @@ static int64_t getNowUs() { static void playSource(OMXClient *client, const sp<MediaSource> &source) { sp<MetaData> meta = source->getFormat(); + int64_t durationUs; + CHECK(meta->findInt64(kKeyDuration, &durationUs)); + sp<OMXCodec> decoder = OMXCodec::Create( client->interface(), meta, false /* createEncoder */, source); @@ -61,7 +64,7 @@ static void playSource(OMXClient *client, const sp<MediaSource> &source) { decoder->start(); - if (gReproduceBug == 3) { + if (gReproduceBug >= 3 && gReproduceBug <= 5) { status_t err; MediaBuffer *buffer; MediaSource::ReadOptions options; @@ -85,10 +88,19 @@ static void playSource(OMXClient *client, const sp<MediaSource> &source) { CHECK(buffer->meta_data()->findInt64(kKeyTime, ×tampUs)); bool failed = false; + if (seekTimeUs >= 0) { int64_t diff = timestampUs - seekTimeUs; - if (diff > 500000) { + if (diff < 0) { + diff = -diff; + } + + if ((gReproduceBug == 4 && diff > 500000) + || (gReproduceBug == 5 && timestampUs < 0)) { + printf("wanted: %.2f secs, got: %.2f secs\n", + seekTimeUs / 1E6, timestampUs / 1E6); + printf("ERROR: "); failed = true; } @@ -105,13 +117,16 @@ static void playSource(OMXClient *client, const sp<MediaSource> &source) { } shouldSeek = ((double)rand() / RAND_MAX) < 0.1; - shouldSeek = false; + + if (gReproduceBug == 3) { + shouldSeek = false; + } } seekTimeUs = -1; if (shouldSeek) { - seekTimeUs = (rand() * 30E6) / RAND_MAX; + seekTimeUs = (rand() * (float)durationUs) / RAND_MAX; options.setSeekTo(seekTimeUs); printf("seeking to %lld us (%.2f secs)\n", |