From 139a5d5bd33c9fc7708d0a79f11ee928f7796e6b Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Thu, 20 May 2010 10:37:06 -0700 Subject: Better handling of codec initialization failure in the player and thumbnail extractor. Return a runtime error instead of asserting if the software MPEG4/H.263 decoder fails to initialize. Change-Id: I5cba02ee85a41e43c2623053de40f26e2cf2efe4 related-to-bug: 2699505 --- media/libstagefright/StagefrightMetadataRetriever.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'media/libstagefright/StagefrightMetadataRetriever.cpp') diff --git a/media/libstagefright/StagefrightMetadataRetriever.cpp b/media/libstagefright/StagefrightMetadataRetriever.cpp index 2968917..258be74 100644 --- a/media/libstagefright/StagefrightMetadataRetriever.cpp +++ b/media/libstagefright/StagefrightMetadataRetriever.cpp @@ -120,7 +120,11 @@ static VideoFrame *extractVideoFrameWithCodecFlags( return NULL; } - decoder->start(); + status_t err = decoder->start(); + if (err != OK) { + LOGW("OMXCodec::start returned error %d (0x%08x)\n", err, err); + return NULL; + } // Read one output buffer, ignore format change notifications // and spurious empty buffers. @@ -134,7 +138,6 @@ static VideoFrame *extractVideoFrameWithCodecFlags( } MediaBuffer *buffer = NULL; - status_t err; do { if (buffer != NULL) { buffer->release(); -- cgit v1.1