summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorIvan Schreter <schreter@gmx.net>2009-02-28 13:14:46 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2009-02-28 13:14:46 +0000
commit5fa61b26f7ed53419bc4b34e14b2bccf944114a6 (patch)
tree305e130e503779df893b6ca95818ec831e46ae56 /libavformat
parentda2911d5e8f562290702812e014ab6db12127cd4 (diff)
Improve frame rate guessing for streams with two fields per frame.
Patch by Ivan Schreter, schreter gmx net Originally committed as revision 17656 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 9354b75886..864fd9e540 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2115,6 +2115,11 @@ int av_find_stream_info(AVFormatContext *ic)
int64_t last= last_dts[index];
int64_t duration= pkt->dts - last;
+ if (st->codec->ticks_per_frame == 2 &&
+ st->parser &&
+ st->parser->repeat_pict == 0)
+ duration *= 2; // two fields are needed per frame
+
if(pkt->dts != AV_NOPTS_VALUE && last != AV_NOPTS_VALUE && duration>0){
double dur= duration * av_q2d(st->time_base);