diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2002-05-20 16:31:13 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2002-05-20 16:31:13 +0000 |
commit | c9a65ca8c306071b3c359b56a384a1594cd505df (patch) | |
tree | a33c4b156673f2c1404042501c1cebaae6a35457 /libav/gif.c | |
parent | db7f1f95acc050bb5ddf62b0008eab8c8305d369 (diff) | |
download | ffmpeg-c9a65ca8c306071b3c359b56a384a1594cd505df.tar.gz |
converted to new API
Originally committed as revision 547 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libav/gif.c')
-rw-r--r-- | libav/gif.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/libav/gif.c b/libav/gif.c index 4aa1ba0b82..42874e033e 100644 --- a/libav/gif.c +++ b/libav/gif.c @@ -192,7 +192,7 @@ typedef struct { static int gif_write_header(AVFormatContext *s) { - GIFContext *gif; + GIFContext *gif = s->priv_data; ByteIOContext *pb = &s->pb; AVCodecContext *enc, *video_enc; int i, width, height, rate; @@ -201,12 +201,6 @@ static int gif_write_header(AVFormatContext *s) if(s->nb_streams > 1) return -1; */ - - gif = av_malloc(sizeof(GIFContext)); - if (!gif) - return -1; - s->priv_data = gif; - gif->time = 0; gif->file_time = 0; @@ -376,28 +370,28 @@ static int gif_write_packet(AVFormatContext *s, int stream_index, static int gif_write_trailer(AVFormatContext *s) { - GIFContext *gif = s->priv_data; ByteIOContext *pb = &s->pb; put_byte(pb, 0x3b); put_flush_packet(&s->pb); - - av_free(gif); return 0; } -AVFormat gif_format = { +static AVOutputFormat gif_oformat = { "gif", "GIF Animation", "image/gif", "gif", + sizeof(GIFContext), CODEC_ID_NONE, CODEC_ID_RAWVIDEO, gif_write_header, gif_write_packet, gif_write_trailer, - - NULL, /* read_header */ - NULL, /* read_packet */ - NULL, /* read_close */ }; + +int gif_init(void) +{ + av_register_output_format(&gif_oformat); + return 0; +} |