[FFmpeg-cvslog] r17656 - trunk/libavformat/utils.c
cehoyos
subversion
Sat Feb 28 14:14:46 CET 2009
Author: cehoyos
Date: Sat Feb 28 14:14:46 2009
New Revision: 17656
Log:
Improve frame rate guessing for streams with two fields per frame.
Patch by Ivan Schreter, schreter gmx net
Modified:
trunk/libavformat/utils.c
Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c Sat Feb 28 09:38:33 2009 (r17655)
+++ trunk/libavformat/utils.c Sat Feb 28 14:14:46 2009 (r17656)
@@ -2115,6 +2115,11 @@ int av_find_stream_info(AVFormatContext
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);
More information about the ffmpeg-cvslog
mailing list