Mercurial > libavformat.hg
changeset 4674:c727d4a90177 libavformat
factorize write packet
author | bcoudurier |
---|---|
date | Sun, 08 Mar 2009 22:14:26 +0000 |
parents | c8161db9d863 |
children | f036a151abf8 |
files | gxfenc.c |
diffstat | 1 files changed, 3 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/gxfenc.c Sun Mar 08 22:12:56 2009 +0000 +++ b/gxfenc.c Sun Mar 08 22:14:26 2009 +0000 @@ -762,7 +762,7 @@ return 16; } -static int gxf_write_media_packet(AVFormatContext *s, AVPacket *pkt) +static int gxf_write_packet(AVFormatContext *s, AVPacket *pkt) { GXFContext *gxf = s->priv_data; ByteIOContext *pb = s->pb; @@ -782,14 +782,9 @@ if (st->codec->codec_type == CODEC_TYPE_VIDEO) gxf->nb_fields += 2; // count fields - return updatePacketSize(pb, pos); -} + put_flush_packet(pb); -static int gxf_write_packet(AVFormatContext *s, AVPacket *pkt) -{ - gxf_write_media_packet(s, pkt); - put_flush_packet(s->pb); - return 0; + return updatePacketSize(pb, pos); } static int gxf_interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush)