Android截屏--桌面同时按住power与音量-截图-截图无声音

问题描述:

【测试步骤】1、桌面同时按住power与音量-截图
【测试结果】截图无声音
【预期结果】不应该无声音

这是一个google common问题,问题原因如下:
decode does not complete when first capture.
solution: for audio sound pool case, skip EOS delay time to faster to send out EOS. 


修改位置:frameworks/av/media/libstagefright/AwesomePlayer.cpp

void AwesomePlayer::postCheckAudioStatusEvent(int64_t delayUs) {
    Mutex::Autolock autoLock(mAudioLock);
    if (mAudioStatusEventPending) {
        return;
    }
    mAudioStatusEventPending = true;
    // Do not honor delay when looping in order to limit audio gap
    if (mFlags & (LOOPING | AUTO_LOOPING)) {
        delayUs = 0;
    }
#ifdef MTK_AOSP_ENHANCEMENT
    // AudioCache needn't delay post EOS, just AudioOutput which with a valid UID needed
    if(!mUIDValid){
        ALOGI("AudioCache needn't delay post EOS!!!");
        //<2015.05.07> modify for start
        delayUs = 0;
        //<2015.05.07> modify for end
    }
#endif
    mQueue.postEventWithDelay(mCheckAudioStatusEvent, delayUs);
}
把delayUs = 3000;改为delayUs = 0;

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。