diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-04-09 22:39:39 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-04-09 22:39:39 +0000 |
commit | 497431a5b645ffc39cf3acbd333c9ff0f3031adb (patch) | |
tree | 08dc22ad4992f6aa023146f24bd50e0cca46ac25 | |
parent | 79f8b328cdf95f26a0096022091a82b365c5d3ce (diff) | |
download | ffmpeg-497431a5b645ffc39cf3acbd333c9ff0f3031adb.tar.gz |
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.
Originally committed as revision 22824 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index aa779ed80d..eaa912612f 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -739,6 +739,11 @@ static void compute_frame_duration(int *pnum, int *pden, AVStream *st, 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: |