# HG changeset patch # User bcoudurier # Date 1232444638 0 # Node ID f146ce39977aea34b3b97583ff3f09124443aeba # Parent af29578c3d77e3f3dbc8eaf1c5f6494532449dc5 Do not use avctx->frame_number which might not be set, this also fixes a side effect where its value was one too much. diff -r af29578c3d77 -r f146ce39977a gxfenc.c --- a/gxfenc.c Tue Jan 20 09:25:50 2009 +0000 +++ b/gxfenc.c Tue Jan 20 09:43:58 2009 +0000 @@ -693,11 +693,8 @@ 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 @@ 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); }