[Ffmpeg-cvslog] CVS: ffmpeg/libavformat avienc.c,1.127,1.128

Michael Niedermayer CVS michael
Thu Mar 2 21:44:37 CET 2006


Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv1033/libavformat

Modified Files:
	avienc.c 
Log Message:
fixing total_frames


Index: avienc.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/avienc.c,v
retrieving revision 1.127
retrieving revision 1.128
diff -u -d -r1.127 -r1.128
--- avienc.c	2 Mar 2006 20:08:01 -0000	1.127
+++ avienc.c	2 Mar 2006 20:44:35 -0000	1.128
@@ -613,22 +613,21 @@
         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;





More information about the ffmpeg-cvslog mailing list