[Libav-user] Memory Leaks?

Harald Schlangmann harry at gps-laptimer.de
Sun Apr 6 00:06:12 CEST 2014


I’m unreferencing it when a frame has been completely read:

>>                int     frameFinished;
>> 
>>                ret = avcodec_decode_video2 (videoSource->pVideoCodecCtx, videoSource->pVideoFrameRaw, &frameFinished, &packet);
>> 
>>                if (ret>=0)
>>                {
>>                    if (frameFinished)
>>                    {
>>>> 
>>                        av_frame_unref (videoSource->pVideoFrameRaw); 

Unreferencing it before the avcodec_decode_video2 is most probably wrong (at least in the theoretical case the frame comes in more than 1 package)?

Greetings Harald

-
Harald Schlangmann
Antwerpener Str. 52, 50672 Köln, Germany
+49 151 2265 4439
Harry at gps-laptimer.de
www.gps-laptimer.de

On 05.04.2014, at 23:01, wm4 <nfxjfg at googlemail.com> wrote:
> 
> Did you unref the frame before passing it to the decoder? In some
> versions of ffmpeg this is required, though it might be incorrect and
> cause memory corruption with some earlier versions of ffmpeg. Either
> way, it's probably an API usage error with AVFrame management.
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4145 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20140406/6f341c45/attachment.p7s>


More information about the Libav-user mailing list