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/avienc.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/avienc.c')
-rw-r--r-- | libav/avienc.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/libav/avienc.c b/libav/avienc.c index 6d2b0ab444..552954107e 100644 --- a/libav/avienc.c +++ b/libav/avienc.c @@ -143,18 +143,12 @@ void parse_specific_params(AVCodecContext *stream, int *au_byterate, int *au_ssi static int avi_write_header(AVFormatContext *s) { - AVIContext *avi; + AVIContext *avi = s->priv_data; ByteIOContext *pb = &s->pb; int bitrate, n, i, nb_frames, au_byterate, au_ssize, au_scale; AVCodecContext *stream, *video_enc; offset_t list1, list2, strh, strf; - avi = av_malloc(sizeof(AVIContext)); - if (!avi) - return -1; - memset(avi, 0, sizeof(AVIContext)); - s->priv_data = avi; - put_tag(pb, "RIFF"); put_le32(pb, 0); /* file length */ put_tag(pb, "AVI "); @@ -388,23 +382,24 @@ static int avi_write_trailer(AVFormatContext *s) url_fseek(pb, file_size, SEEK_SET); } put_flush_packet(pb); - - av_free(avi); return 0; } -AVFormat avi_format = { +static AVOutputFormat avi_oformat = { "avi", "avi format", "video/x-msvideo", "avi", + sizeof(AVIContext), CODEC_ID_MP2, CODEC_ID_MSMPEG4, avi_write_header, avi_write_packet, avi_write_trailer, - - avi_read_header, - avi_read_packet, - avi_read_close, }; + +int avienc_init(void) +{ + av_register_output_format(&avi_oformat); + return 0; +} |