resolved conflicts for merge of f585be7f to eclair-mr2

This commit is contained in:
Andreas Huber
2009-10-16 15:32:50 -07:00

View File

@@ -52,6 +52,9 @@ static int64_t getNowUs() {
static void playSource(OMXClient *client, const sp<MediaSource> &source) { static void playSource(OMXClient *client, const sp<MediaSource> &source) {
sp<MetaData> meta = source->getFormat(); sp<MetaData> meta = source->getFormat();
int64_t durationUs;
CHECK(meta->findInt64(kKeyDuration, &durationUs));
sp<OMXCodec> decoder = OMXCodec::Create( sp<OMXCodec> decoder = OMXCodec::Create(
client->interface(), meta, false /* createEncoder */, source); client->interface(), meta, false /* createEncoder */, source);
@@ -61,7 +64,7 @@ static void playSource(OMXClient *client, const sp<MediaSource> &source) {
decoder->start(); decoder->start();
if (gReproduceBug == 3) { if (gReproduceBug >= 3 && gReproduceBug <= 5) {
status_t err; status_t err;
MediaBuffer *buffer; MediaBuffer *buffer;
MediaSource::ReadOptions options; MediaSource::ReadOptions options;
@@ -85,10 +88,19 @@ static void playSource(OMXClient *client, const sp<MediaSource> &source) {
CHECK(buffer->meta_data()->findInt64(kKeyTime, &timestampUs)); CHECK(buffer->meta_data()->findInt64(kKeyTime, &timestampUs));
bool failed = false; bool failed = false;
if (seekTimeUs >= 0) { if (seekTimeUs >= 0) {
int64_t diff = timestampUs - seekTimeUs; 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: "); printf("ERROR: ");
failed = true; failed = true;
} }
@@ -105,13 +117,16 @@ static void playSource(OMXClient *client, const sp<MediaSource> &source) {
} }
shouldSeek = ((double)rand() / RAND_MAX) < 0.1; shouldSeek = ((double)rand() / RAND_MAX) < 0.1;
shouldSeek = false;
if (gReproduceBug == 3) {
shouldSeek = false;
}
} }
seekTimeUs = -1; seekTimeUs = -1;
if (shouldSeek) { if (shouldSeek) {
seekTimeUs = (rand() * 30E6) / RAND_MAX; seekTimeUs = (rand() * (float)durationUs) / RAND_MAX;
options.setSeekTo(seekTimeUs); options.setSeekTo(seekTimeUs);
printf("seeking to %lld us (%.2f secs)\n", printf("seeking to %lld us (%.2f secs)\n",