# HG changeset patch # User bcoudurier # Date 1168259596 0 # Node ID bdb50e314f2982dceb840a8c5a4226209920c640 # Parent ac2a299df03147057cf810c680d85c9f2efb32a7 priv_data is allocated/freed internally diff -r ac2a299df031 -r bdb50e314f29 swf.c --- a/swf.c Sun Jan 07 00:02:15 2007 +0000 +++ b/swf.c Mon Jan 08 12:33:16 2007 +0000 @@ -306,18 +306,13 @@ /* */ static int swf_write_header(AVFormatContext *s) { - SWFContext *swf; + SWFContext *swf = s->priv_data; ByteIOContext *pb = &s->pb; AVCodecContext *enc, *audio_enc, *video_enc; PutBitContext p; uint8_t buf1[256]; int i, width, height, rate, rate_base; - swf = av_malloc(sizeof(SWFContext)); - if (!swf) - return -1; - s->priv_data = swf; - swf->ch_id = -1; swf->audio_in_pos = 0; swf->audio_out_pos = 0; @@ -452,7 +447,6 @@ /* not supported */ av_log(s, AV_LOG_ERROR, "swf doesnt support that sample rate, choose from (44100, 22050, 11025)\n"); av_free(swf->audio_fifo); - av_free(swf); return -1; } v |= 0x02; /* 16 bit playback */