diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-03-02 20:44:35 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-03-02 20:44:35 +0000 |
commit | 61452d5637bf422cd845eb5eb16b11a161831b73 (patch) | |
tree | 4fe66cd5b0d1df6f249edd3851632f46f0191d16 /libavformat/avienc.c | |
parent | 98740f5a798df8c898959aab8e954713149dc62d (diff) | |
download | ffmpeg-streaming-61452d5637bf422cd845eb5eb16b11a161831b73.zip ffmpeg-streaming-61452d5637bf422cd845eb5eb16b11a161831b73.tar.gz |
fixing total_frames
Originally committed as revision 5101 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avienc.c')
-rw-r--r-- | libavformat/avienc.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libavformat/avienc.c b/libavformat/avienc.c index 2239e26..dbb301d 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -613,22 +613,21 @@ static int avi_write_idx1(AVFormatContext *s) file_size = url_ftell(pb); nb_frames = 0; for(n=0;n<s->nb_streams;n++) { - if (avi->frames_hdr_strm[n] != 0) { + assert(avi->frames_hdr_strm[n]); stream = s->streams[n]->codec; 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, avi->packet_count[n]); - nb_frames += avi->packet_count[n]; } else { put_le32(pb, avi->audio_strm_length[n] / au_ssize); } - } - } - if (avi->frames_hdr_all != 0) { - url_fseek(pb, avi->frames_hdr_all, SEEK_SET); - put_le32(pb, nb_frames); + if(stream->codec_type == CODEC_TYPE_VIDEO) + nb_frames = FFMAX(nb_frames, avi->packet_count[n]); } + assert(avi->frames_hdr_all); + url_fseek(pb, avi->frames_hdr_all, SEEK_SET); + put_le32(pb, nb_frames); url_fseek(pb, file_size, SEEK_SET); } return 0; |