Fixed a invalid fd issue

LinearBlock close the fd why it's recycled, so we need dup the fd to create a LinearBlock.

bug: 159753135
Test: Manual
Change-Id: Ic2b4e3c535e60983b2a4fc5f5ce6e809731fd581
This commit is contained in:
Henry Fang
2020-06-23 17:47:51 -07:00
parent e948137a18
commit 7f61a67c41

View File

@@ -335,7 +335,7 @@ jobject MediaEvent::getLinearBlock() {
if (mLinearBlockObj != NULL) {
return mLinearBlockObj;
}
mIonHandle = new C2HandleIon(mAvHandle->data[0], mDataLength);
mIonHandle = new C2HandleIon(dup(mAvHandle->data[0]), mDataLength);
std::shared_ptr<C2LinearBlock> block = _C2BlockFactory::CreateLinearBlock(mIonHandle);
JNIEnv *env = AndroidRuntime::getJNIEnv();