# HG changeset patch # User michael # Date 1138209256 0 # Node ID ef25e246c7f2d038e38bdf9d12772adace9ed63a # Parent 97a083dcfb7b13967c4b590f32dec4650b705b55 avoid using non constant fields of AVCodecContext in avi muxer diff -r 97a083dcfb7b -r ef25e246c7f2 avienc.c --- a/avienc.c Wed Jan 25 16:04:31 2006 +0000 +++ b/avienc.c Wed Jan 25 17:14:16 2006 +0000 @@ -613,8 +613,8 @@ url_fseek(pb, avi->frames_hdr_strm[n], SEEK_SET); ff_parse_specific_params(stream, &au_byterate, &au_ssize, &au_scale); if (au_ssize == 0) { - put_le32(pb, stream->frame_number); - nb_frames += stream->frame_number; + put_le32(pb, avi->packet_count[n]); + nb_frames += avi->packet_count[n]; } else { put_le32(pb, avi->audio_strm_length[n] / au_ssize); } @@ -730,11 +730,11 @@ for (n=nb_frames=0;nnb_streams;n++) { AVCodecContext *stream = s->streams[n]->codec; if (stream->codec_type == CODEC_TYPE_VIDEO) { - if (nb_frames < stream->frame_number) - nb_frames = stream->frame_number; + if (nb_frames < avi->packet_count[n]) + nb_frames = avi->packet_count[n]; } else { if (stream->codec_id == CODEC_ID_MP2 || stream->codec_id == CODEC_ID_MP3) { - nb_frames += stream->frame_number; + nb_frames += avi->packet_count[n]; } } }