[SDL] Leaks in FFPLAY

Ulrich Eckhardt doomster at knuut.de
Fri May 11 07:08:54 PDT 2007


On Friday 11 May 2007 02:54:31 Pankaj wrote:
> *pkt = pkt1->pkt;
> av_free(pkt1);
>
> Pkt1 is a struct  defined as
>
> typedef struct AVPacketList {
> AVPacket pkt;
> struct AVPacketList *next;
> } AVPacketList;
>
> I do not understand if we are freeing something then how can use it again?

You can't or maybe I don't understand what you mean. That said, this seems 
like a simple algorithm in C where an element is removed from a linked list. 
The puzzling point might be that '*pkt' now contains a copy(!) of the 
former 'pkt1->pkt', and the copy is independent from the original.

BTW: this is completely off-topic here and rather belongs into a C beginners 
area. Further, check ACCU's website for book reviews, it's really hard to 
learn C only from the net.

cheers

Uli


More information about the SDL mailing list