Nikita Vaňků (12023-04-25): > > You probably need to copy the frame at least once. > I do not understand what exactly you mean
The word copy appears only five times in the documentation of the frame API, it is not that hard to find the right one. > I ran the SW decoder for several hours and noticed no memory leak. Ok. > Out of frustration, I tried to minimize the code, I now know that if I > keep reusing a single frame (allocate it once and never free it) the > problem disappears. But as soon as I try to allocate new frames for > each decoded frame while using HW acceleration I start running into > these issues. > > The code for this is very simple on the decoding side I simply: > > AVFrame* frame = av_frame_alloc(); > ret = avcodec_receive_frame(m_codecContext, frame); > av_packet_unref(m_packet); > if (ret == AVERROR(EAGAIN)) { > av_frame_free(&frame); > continue; > } else if (ret == AVERROR_EOF) { > av_frame_free(&frame); > break; > } else if (ret != 0) { > av_frame_free(&frame); > break; > } > > I skipped the processing and just call av_frame_free on the processing > side. The queue for this purpose is a size of 4. Errors in linux > differs from those experienced on Windows Try copying the frame before adding it to the queue and see if it fixes things. Regards, -- Nicolas George
signature.asc
Description: PGP signature
_______________________________________________ Libav-user mailing list Libav-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/libav-user To unsubscribe, visit link above, or email libav-user-requ...@ffmpeg.org with subject "unsubscribe".