Mercurial > libavformat.hg
changeset 4607:075a4add0487 libavformat
Improve frame rate guessing for streams with two fields per frame.
Patch by Ivan Schreter, schreter gmx net
author | cehoyos |
---|---|
date | Sat, 28 Feb 2009 13:14:46 +0000 |
parents | c520c49e79f6 |
children | 161a36f844ce |
files | utils.c |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/utils.c Fri Feb 27 23:12:14 2009 +0000 +++ b/utils.c Sat Feb 28 13:14:46 2009 +0000 @@ -2115,6 +2115,11 @@ 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);