android ndk fd获取实际文件,android - OpenSL ES-Android Studio-NDK 10R - 堆栈内存溢出

我有一个运行正常的OPENSL ES声音引擎,正在使用android NDK 9编译的Eclipse中的旧项目。在该配置下,它在这里工作正常。

当我将项目转移到Android Studio时,当我尝试播放任何声音时,尝试CreateAudioPlayer时会崩溃。 除了声音问题以外,其他所有功能都可以正常工作。

我正在将Android Studio 1.5.1与com.android.tools.build:gradle-experimental:0.4.0插件和NDK 10 R(最新版本)一起使用。

SLDataLocator_AndroidFD loc_fd = {SL_DATALOCATOR_ANDROIDFD, _FileDescriptor, cache_FileDescriptorStart, cache_FileDescriptorLength};

SLDataFormat_MIME format_mime = {SL_DATAFORMAT_MIME, NULL, SL_CONTAINERTYPE_UNSPECIFIED};

audioSrc = {&loc_fd, &format_mime};

// configure audio sink

SLDataLocator_OutputMix loc_outmix = {SL_DATALOCATOR_OUTPUTMIX, outputMixObject};

SLDataSink audioSnk = {&loc_outmix, NULL};

// create audio player

const SLInterfaceID ids[3] = {SL_IID_SEEK, SL_IID_MUTESOLO, SL_IID_VOLUME};

const SLboolean req[3] = {SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE};

LOG("Sound: error with %s", _SoundName);

result = (*engineEngine)->CreateAudioPlayer(engineEngine, &uriPlayerObject, &audioSrc,&audioSnk, 3, ids, req);

LOG("playStream end");

它在此行崩溃:

result = (*engineEngine)->CreateAudioPlayer(engineEngine, &uriPlayerObject, &audioSrc,&audioSnk, 3, ids, req);

我已经检查了文件描述符值,ids值,进入CreateAudioPlayer函数的每个参数,一切对我来说都很好。

LogCat没有给出任何合理的消息,这是日志:

01-20 20:59:34.705 6256-6287/com.test.full W/google- breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###

01-20 20:59:34.706 6256-6287/com.test.full W/google-breakpad: Chrome build fingerprint:

01-20 20:59:34.706 6256-6287/com.test.full W/google-breakpad: 2

01-20 20:59:34.706 6256-6287/com.test.full W/google-breakpad: 869b37da-2f6d-4460-8f9f-e1bd9177efc1

01-20 20:59:34.706 6256-6287/com.test.full W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###

01-20 20:59:34.706 6256-6287/com.test.full A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x1 in tid 6287 (GLThread 2240)

正如我所看到的,问题出在Android NDK 10中,因为当我使用版本9进行编译时,它运行良好。

有人遇到过这类问题吗?

谢谢。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值