Open ChanJLee opened 6 years ago
1 #00 pc 0003c19c /system/lib/libc.so (tgkill+12) [armeabi-v7a] 2 #01 pc 00016551 /system/lib/libc.so (pthread_kill+52) [armeabi-v7a] 3 #02 pc 00017163 /system/lib/libc.so (raise+10) [armeabi-v7a] 4 #03 pc 000139b5 /system/lib/libc.so (__libc_android_abort+36) [armeabi-v7a] 5 #04 pc 00012054 /system/lib/libc.so (abort+4) [armeabi-v7a] 6 #05 pc 00007a71 /system/lib/libcutils.so (__android_log_assert+88) [armeabi-v7a] 7 #06 pc 0006dbeb /system/lib/libstagefright.so (android::ACodec::getPortFormat(unsigned int, android::sp<android::AMessage>&)+222) [armeabi-v7a] 8 #07 pc 0006f0e9 /system/lib/libstagefright.so (android::ACodec::configureCodec(char const*, android::sp<android::AMessage> const&)+1600) [armeabi-v7a] 9 #08 pc 0006f72d /system/lib/libstagefright.so (android::ACodec::LoadedState::onConfigureComponent(android::sp<android::AMessage> const&)+92) [armeabi-v7a] 10 #09 pc 00070731 /system/lib/libstagefright.so (android::ACodec::LoadedState::onMessageReceived(android::sp<android::AMessage> const&)+36) [armeabi-v7a] 11 #10 pc 0000b025 /system/lib/libstagefright_foundation.so (android::AHierarchicalStateMachine::handleMessage(android::sp<android::AMessage> const&)+44) [armeabi-v7a] 12 #11 pc 00068157 /system/lib/libstagefright.so [armeabi-v7a] 13 #12 pc 0000bdab /system/lib/libstagefright_foundation.so (android::ALooperRoster::deliverMessage(android::sp<android::AMessage> const&)+166) [armeabi-v7a] 14 #13 pc 0000b72d /system/lib/libstagefright_foundation.so (android::ALooper::loop()+220) [armeabi-v7a] 15 #14 pc 00010e65 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+112) [armeabi-v7a] 16 #15 pc 0005ec0d /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+72) [armeabi-v7a] 17 #16 pc 000109d5 /system/lib/libutils.so [armeabi-v7a] 18 #17 pc 00015d3f /system/lib/libc.so (__pthread_start(void*)+30) [armeabi-v7a] 19 #18 pc 00013d13 /system/lib/libc.so (__start_thread+6) [armeabi-v7a]
MediaCodecInfo mediaCodecInfo = MediaCodecUtil.getDecoderInfo("audio/mpeg", false); MediaCodec mediaCodec = MediaCodec.createByCodecName(mediaCodecInfo.name); MediaFormat mediaFormat = new MediaFormat(); mediaFormat.setInteger(MediaFormat.KEY_MAX_INPUT_SIZE, 4096); mediaFormat.setString(MediaFormat.KEY_MIME, "audio/mpeg"); mediaFormat.setInteger("encoder-delay", 576); mediaFormat.setInteger(MediaFormat.KEY_CHANNEL_COUNT, 2); mediaFormat.setInteger("encoder-padding", 1728); mediaFormat.setInteger(MediaFormat.KEY_SAMPLE_RATE, 44100); mediaCodec.configure(mediaFormat, null, null, 0);
这个可能是由于用了一个它并不支持的MediaCodec,可以试试先用 MediaCodecList 获取支持的列表
MediaCodecUtil.getDecoderInfo 会去查找它支持的MediaCodec,这个Bug在高版本的Funtouch OS_2.5.1系统中已经被修复了。