[FFmpeg-cvslog] r22824 - trunk/libavformat/utils.c

michael subversion
Sat Apr 10 00:39:40 CEST 2010


Author: michael
Date: Sat Apr 10 00:39:39 2010
New Revision: 22824

Log:
Dont try to compute AVPacket duration for possibly interlaced video codecs
when no parser is available.
This partly fixes the frame rate misdetection in issue1756.

Modified:
   trunk/libavformat/utils.c

Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c	Fri Apr  9 19:52:34 2010	(r22823)
+++ trunk/libavformat/utils.c	Sat Apr 10 00:39:39 2010	(r22824)
@@ -739,6 +739,11 @@ static void compute_frame_duration(int *
             if (pc && pc->repeat_pict) {
                 *pnum = (*pnum) * (1 + pc->repeat_pict);
             }
+            //If this codec can be interlaced or progressive then we need a parser to compute duration of a packet
+            //Thus if we have no parser in such case leave duration undefined.
+            if(st->codec->ticks_per_frame>1 && !pc){
+                *pnum = *pden = 0;
+            }
         }
         break;
     case AVMEDIA_TYPE_AUDIO:



More information about the ffmpeg-cvslog mailing list