ref: 1fa1d2f1c158f322855fb2ecdb7ba73a9f07947a
parent: aa2cfef31082d501776c1786ff315665f4da43e1
parent: 8662eca2c3314486a56b1c144b07e39dbda600e8
author: ruil2 <[email protected]>
date: Tue Jul 1 04:51:52 EDT 2014
Merge pull request #1049 from ethanhugg/frameleak Fix for memory leak of input frames in encoder.
--- a/module/gmp-openh264.cpp
+++ b/module/gmp-openh264.cpp
@@ -342,6 +342,11 @@
}
if (!has_frame) {
+ // This frame must be destroyed on the main thread.
+ g_platform_api->syncrunonmainthread (WrapTask (
+ this,
+ &OpenH264VideoEncoder::DestroyInputFrame_m,
+ inputImage));
return;
}
@@ -418,6 +423,11 @@
callback_->Encoded (f, info);
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) {