# HG changeset patch # User michael # Date 1270852779 0 # Node ID 57789f5d12cf1fd4833c0a6e29104bf3c666787e # Parent b106b59bf663568f4bd3c7bc34d992c5991bab88 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. diff -r b106b59bf663 -r 57789f5d12cf utils.c --- a/utils.c Thu Apr 08 09:47:32 2010 +0000 +++ b/utils.c Fri Apr 09 22:39:39 2010 +0000 @@ -739,6 +739,11 @@ 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: