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/codecs/m4v_h263/dec/M4vH263Decoder.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'media/libstagefright/codecs/m4v_h263/dec') diff --git a/media/libstagefright/codecs/m4v_h263/dec/M4vH263Decoder.cpp b/media/libstagefright/codecs/m4v_h263/dec/M4vH263Decoder.cpp index 40009f8..8350f7a 100644 --- a/media/libstagefright/codecs/m4v_h263/dec/M4vH263Decoder.cpp +++ b/media/libstagefright/codecs/m4v_h263/dec/M4vH263Decoder.cpp @@ -120,9 +120,16 @@ status_t M4vH263Decoder::start(MetaData *) { vol_size = 0; } - CHECK_EQ(PV_TRUE, PVInitVideoDecoder( - mHandle, vol_data, &vol_size, 1, mWidth, mHeight, mode)); + + Bool success = PVInitVideoDecoder( + mHandle, vol_data, &vol_size, 1, mWidth, mHeight, mode); if (vol_data[0]) free(vol_data[0]); + + if (success != PV_TRUE) { + LOGW("PVInitVideoDecoder failed. Unsupported content?"); + return ERROR_UNSUPPORTED; + } + MP4DecodingMode actualMode = PVGetDecBitstreamMode(mHandle); CHECK_EQ(mode, actualMode); -- cgit v1.1