Merge pull request #1049 from ethanhugg/frameleak

Fix for memory leak of input frames in encoder.
This commit is contained in:
ruil2 2014-07-01 08:51:52 +08:00
commit 1fa1d2f1c1

View File

@ -342,6 +342,11 @@ class OpenH264VideoEncoder : public GMPVideoEncoder {
}
if (!has_frame) {
// This frame must be destroyed on the main thread.
g_platform_api->syncrunonmainthread (WrapTask (
this,
&OpenH264VideoEncoder::DestroyInputFrame_m,
inputImage));
return;
}
@ -420,6 +425,11 @@ class OpenH264VideoEncoder : public GMPVideoEncoder {
stats_.FrameOut();
}
// These frames must be destroyed on the main thread.
void DestroyInputFrame_m (GMPVideoi420Frame* frame) {
frame->Destroy();
}
virtual GMPVideoErr SetChannelParameters (uint32_t aPacketLoss, uint32_t aRTT) {
return GMPVideoNoErr;
}