Hey guys, 

I’m creating a recording application and I have an incoming frame which I’d 
like to convert to JPEG without writing it to a movie file.
However, I need to use libav’s V210 decoder before creating the JPEG data.

I’m getting a memory leak in this code:

AVPacket pkt;
av_init_packet(&pkt);
            
pkt.flags |= AV_PKT_FLAG_KEY;
pkt.stream_index  = 0;
pkt.data = imgData;
pkt.size = ...
    
int gotPctr = 0;
    
AVFrame* frameGrabFrame = av_frame_alloc();
avcodec_decode_video2(_pV210CodecCtxFrameGrab, frameGrabFrame, &gotPctr, &pkt);
    
I get a memory consumption increase of about 13 MB after the avcodec_decode 
call.
However, I can’t manage to free the memory. I already tried without success:

    av_free_packet(&pkt);
    av_frame_unref(frameGrabFrame);
    av_frame_free(&frameGrabFrame);


I’m not using reference counting by the way.
I’m sure that’s a dumb one … sorry for that.

Any advice appreciated!
Thanks!
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to