[Ffmpeg-cvslog] CVS: ffmpeg/libavformat utils.c,1.147,1.148

Michael Niedermayer CVS michael
Sun May 22 10:47:12 CEST 2005


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

Modified Files:
	utils.c 
Log Message:
av_find_stream_info() end check fixes
  10l (wrong time base)
  use timestamps if duration isnt available


Index: utils.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/utils.c,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -d -r1.147 -r1.148
--- utils.c	19 May 2005 00:06:27 -0000	1.147
+++ utils.c	22 May 2005 08:47:09 -0000	1.148
@@ -1797,7 +1797,7 @@
         if (pkt->duration != 0)
             st->codec_info_nb_frames++;
 
-        if(st->codec.codec_type == CODEC_TYPE_VIDEO){
+        {
             int index= pkt->stream_index;
             int64_t last= last_dts[index];
             int64_t duration= pkt->dts - last;
@@ -1811,6 +1811,8 @@
                     duration_sum[index] += duration;
                     duration_count[index]+= factor;
                 }
+                if(st->codec_info_nb_frames == 0)
+                    st->codec_info_duration += duration;
             }
             last_dts[pkt->stream_index]= pkt->dts;
         }
@@ -1835,7 +1837,7 @@
              (st->codec.codec_id == CODEC_ID_MPEG4 && !st->need_parsing))*/)
             try_decode_frame(st, pkt->data, pkt->size);
         
-        if (st->codec_info_duration >= MAX_STREAM_DURATION) {
+        if (av_rescale_q(st->codec_info_duration, st->time_base, AV_TIME_BASE_Q) >= MAX_STREAM_DURATION) {
             break;
         }
         count++;





More information about the ffmpeg-cvslog mailing list