Commit b2b540ca authored by bcoudurier's avatar bcoudurier

priv_data is allocated/freed internally

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@7426 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 492435ac
...@@ -306,18 +306,13 @@ static void put_swf_matrix(ByteIOContext *pb, ...@@ -306,18 +306,13 @@ static void put_swf_matrix(ByteIOContext *pb,
/* */ /* */
static int swf_write_header(AVFormatContext *s) static int swf_write_header(AVFormatContext *s)
{ {
SWFContext *swf; SWFContext *swf = s->priv_data;
ByteIOContext *pb = &s->pb; ByteIOContext *pb = &s->pb;
AVCodecContext *enc, *audio_enc, *video_enc; AVCodecContext *enc, *audio_enc, *video_enc;
PutBitContext p; PutBitContext p;
uint8_t buf1[256]; uint8_t buf1[256];
int i, width, height, rate, rate_base; 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->ch_id = -1;
swf->audio_in_pos = 0; swf->audio_in_pos = 0;
swf->audio_out_pos = 0; swf->audio_out_pos = 0;
...@@ -452,7 +447,6 @@ static int swf_write_header(AVFormatContext *s) ...@@ -452,7 +447,6 @@ static int swf_write_header(AVFormatContext *s)
/* not supported */ /* not supported */
av_log(s, AV_LOG_ERROR, "swf doesnt support that sample rate, choose from (44100, 22050, 11025)\n"); 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->audio_fifo);
av_free(swf);
return -1; return -1;
} }
v |= 0x02; /* 16 bit playback */ v |= 0x02; /* 16 bit playback */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment