diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-01-20 09:43:58 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-01-20 09:43:58 +0000 |
commit | 507ff760afa91f77e82110fc6193808c5e0973bc (patch) | |
tree | 76cb4b655e77187937a86b09454e77fbae98adff /libavformat/gxfenc.c | |
parent | 27052238c083e512a1aef27252c6eb537e313739 (diff) | |
download | ffmpeg-507ff760afa91f77e82110fc6193808c5e0973bc.tar.gz |
Do not use avctx->frame_number which might not be set,
this also fixes a side effect where its value was one too much.
Originally committed as revision 16701 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/gxfenc.c')
-rw-r--r-- | libavformat/gxfenc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c index 229acc9448..77a2927447 100644 --- a/libavformat/gxfenc.c +++ b/libavformat/gxfenc.c @@ -693,11 +693,8 @@ static int gxf_write_trailer(AVFormatContext *s) int i; for (i = 0; i < s->nb_streams; ++i) { - if (s->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) { + if (s->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) av_fifo_free(&gxf->streams[i].audio_buffer); - } else if (s->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO) { - gxf->nb_frames = 2 * s->streams[i]->codec->frame_number; - } } gxf_write_eos_packet(pb, gxf); @@ -772,6 +769,10 @@ static int gxf_write_media_packet(ByteIOContext *pb, GXFContext *ctx, AVPacket * gxf_write_media_preamble(pb, ctx, pkt, pkt->size + padding); put_buffer(pb, pkt->data, pkt->size); gxf_write_padding(pb, padding); + + if (sc->codec->codec_type == CODEC_TYPE_VIDEO) + ctx->nb_frames += 2; // count fields + return updatePacketSize(pb, pos); } |