@@ -129,23 +129,23 @@ bool Recorder::init(const RenderSettings& settings) {
129129 return false ;
130130 }
131131
132- m_convertedFrame = av_frame_alloc ();
133- m_convertedFrame->format = m_codecContext->pix_fmt ;
134- m_convertedFrame->width = m_codecContext->width ;
135- m_convertedFrame->height = m_codecContext->height ;
136- if (av_image_alloc (m_convertedFrame->data , m_convertedFrame->linesize , m_convertedFrame->width , m_convertedFrame->height , m_codecContext->pix_fmt , 32 ) < 0 ) {
137- geode::log::error (" Could not allocate raw picture buffer." );
138- return false ;
139- }
140-
141- m_filteredFrame = av_frame_alloc ();
142- m_filteredFrame->format = m_codecContext->pix_fmt ;
143- m_filteredFrame->width = m_codecContext->width ;
144- m_filteredFrame->height = m_codecContext->height ;
145- if (av_image_alloc (m_filteredFrame->data , m_filteredFrame->linesize , m_filteredFrame->width , m_filteredFrame->height , m_codecContext->pix_fmt , 32 ) < 0 ) {
146- geode::log::error (" Could not allocate raw picture buffer." );
147- return false ;
148- }
132+ // m_convertedFrame = av_frame_alloc();
133+ // m_convertedFrame->format = m_codecContext->pix_fmt;
134+ // m_convertedFrame->width = m_codecContext->width;
135+ // m_convertedFrame->height = m_codecContext->height;
136+ // if(av_image_alloc(m_convertedFrame->data, m_convertedFrame->linesize, m_convertedFrame->width, m_convertedFrame->height, m_codecContext->pix_fmt, 32) < 0) {
137+ // geode::log::error("Could not allocate raw picture buffer.");
138+ // return false;
139+ // }
140+
141+ // m_filteredFrame = av_frame_alloc();
142+ // m_filteredFrame->format = m_codecContext->pix_fmt;
143+ // m_filteredFrame->width = m_codecContext->width;
144+ // m_filteredFrame->height = m_codecContext->height;
145+ // if(av_image_alloc(m_filteredFrame->data, m_filteredFrame->linesize, m_filteredFrame->width, m_filteredFrame->height, m_codecContext->pix_fmt, 32) < 0) {
146+ // geode::log::error("Could not allocate raw picture buffer.");
147+ // return false;
148+ // }
149149
150150 m_packet = new AVPacket ();
151151
@@ -255,6 +255,9 @@ bool Recorder::writeFrame(const std::vector<uint8_t>& frameData) {
255255 av_packet_unref (m_packet);
256256 }
257257
258+ av_frame_unref (m_convertedFrame);
259+ av_frame_unref (m_filteredFrame);
260+
258261 return true ;
259262}
260263
0 commit comments